I'm working on writing a MUD-like game (in Python, if that matters). I've noticed that the Windows telnet client and Ubuntu's telnet client behave slightly differently when connecting to the server.
In Ubuntu, I type something, but the server doesn't recieve anything until I press enter. With Windows, every keystroke is sent to the se...
I am not using GraphViz because I am having problems with making it play nice with Networkx. I know this is weird, but I've tried many suggestions to fix this problem, but I just seem to have some of the worst luck in the world. Therefore the problem that I have must be solved withing Networkx without using GraphViz.
My program reads a ...
I'm trying to keep a widget put into a QTreeWidgetItem after a reparent (drag and drop) using QTreeWidget.setItemWidget()
But the result, if you compile the following code - is that the widget inside the QTreeWidgetItem disappears.
Any idea why? What code would fix this (repopulate the QTreeWidgetItem with the widget I guess?)
from Py...
How can I do something like
if sys.argv[0] != '%windir%\\blabla.exe'
I'm having no success at all
...
right now its set up to write to a file, but I want it to output the value to a variable. not sure how.
from BeautifulSoup import BeautifulSoup
import sys, re, urllib2
import codecs
woof1 = urllib2.urlopen('someurl').read()
woof_1 = BeautifulSoup(woof1)
woof2 = urllib2.urlopen('someurl').read()
woof_2 = BeautifulSoup(woof2)
GE_DB = o...
I have an array of points in unknown dimensional space, such as:
data=numpy.array(
[[ 115, 241, 314],
[ 153, 413, 144],
[ 535, 2986, 41445]])
and I would like to find the average euclidean distance between all points.
Please note that I have over 20,000 points, so I would like to do this as efficiently as possible.
Thanks.
...
How do I use lookahead assertion to determine if a certain character exist at most a certain number of times in a string.
For example, let's say I want to check a string that has at least one character to make sure that it contains "@" at most 2 times. Thanks in advance. Using python if that matters.
...
How can I make a verify error for this command?
if blablablabla:
os.makedirs('C:\\test\\')
If the folder already exists, he return me an error... how can I make it ignore this error? and move on ?
...
I'm trying to create a key like this
_winreg.CreateKey(_winreg.HKEY_LOCAL_MACHINE, 'Software\\Microsoft\\Shared Tools\\MSCONFIG\\startupreg\\test\\')
and the key is beeing created here
HKLM\Software\Wow6432Node\Microsoft\Shared Tools\MSCONFIG\startupreg\test\
why?
Yes, Windows 7 64x here
...
The output from the following:
import feedparser
d = feedparser.parse('http://www.netflix.com/NewWatchInstantlyRSS')
d.entries[177].keys()
is:
['summary_detail', 'links', 'title', 'summary', 'guidislink', 'title_detail', 'link', 'id']
According to http://feedparser.org/docs/common-rss-elements.html, there should be a "date" element...
the windows registry may contain keys whose names with embedded nulls
when i call _winreg.OpenKey(key, subkey_string_with_embbeded_null) i get the following error:
TypeError: OpenKey() argument 2 must be string without null bytes or None, not str
Q1: is the meaning of the error that python _winreg module has a limitation that it cann...
In Python 2.6.4:
>> ''>0
True
Why is that?
...
Is there an abstraction that will allow me to connect to a samba share in python regardless of my platform?
More information
I do not want to mount a share. I simply want to upload files to a share, such as smbclient's put.
Thanks,
Pete
...
Hey folks,
thanks for helping me setting my cron jobs, crontab has really been a gold mine for me.
Unfortunately I have a problem, and have no idea what so ever what it might be... basically a job does not start while the neighbour jobs do. I'll explain
This is my crontabs job list:
*/10 * * * * python /webapps/foo/manage.py fe...
Hi. I'm writing a python module for a device that interacts with a user supplied USB memory stick. The user can insert a USB memory stick in the device USB slot, and the device will dump data onto the memory stick without user intervention. If the device is running when the user inserts the USB stick, I have hooked into D-Bus and have an...
I have a script that uses BeautifulSoup that I want to make into a standalone app using py2app. When I run the app made by py2app I get an error saying that the module BeautifulSoup could not be found. My sys.path has '/Library/Python/2.6/site-packages/BeautifulSoup-3.1.0.1-py2.6.egg' so it seems like it should be there, any advice?
...
I'm working on a system than has to be pretty scalable from the beginning. I've started looking at / playing around with asynchronous/evented approaches to writing serverside code. I've played around with both ruby's EventMachine and node.js.
EventMachine is cool, but doesn't have asynchronous file I/O, which I need. The interface is ki...
Ubuntu Server 9.10,
Here is my file, test.py
import commands
blkid = commands.getoutput('blkid')
print blkid
When I manually run (as SU) this:
python test.py
I get the output of the blkid as expected:
/dev/sda1: UUID="3f0ac5bb-f0da-4574-81f5-77844530b561" TYPE="ext4"
/dev/sda5: UUID="67df0e7c-74fb-47dd-8520-ad720fbed67d" TYPE="swa...
what is the best way to draw a rounded rectangle in a pygtk application
...
My program uses wx.ProgressDialog to give feedback on a process that is in multiple stages. At the beginning of each stage, I use the second argument of Update to change the message in the dialog.
The problem is that the width of the dialog is determined from the message in the constructor, and the dialog is not resized if a later call...