Where does setuptools live?

2009-07-04 Thread David Wilson
I'm trying to create a patch for a diabolical issue I keep running into, but I can't seem to find the setuptools repository. Is it this one? http://svn.python.org/view/sandbox/trunk/setuptools/ It's seen no changes in 9 months. The issue in question is its (ab)use of .svn to directly read wo

itertools.intersect?

2009-06-10 Thread David Wilson
Hi, During a fun coding session yesterday, I came across a problem that I thought was already solved by itertools, but on investigation it seems it isn't. The problem is simple: given one or more ordered sequences, return only the objects that appear in each sequence, without reading the whole se

Python 2.6 json & encoding of datetime.

2008-10-10 Thread David Wilson
Hi there, I've been playing with Python's new json library, and found myself facing a seemingly simple problem: encoding of datetime objects. Some 'jsonlib' that I was using previously was unable to do this, and the new built-in json module shares the same limitation. A bit of googling around bro

Re: Events: The Python Way

2007-07-28 Thread David Wilson
Hi there, Python has no built-in way of doing this. You may consider writing your own class if you like this pattern (I personally do): class Event(object): def __init__(self): self.subscribers = set() def __iadd__(self, subscriber): self.subscribers.add(subscriber)

Re: this must be a stupid question ...

2007-07-28 Thread David Wilson
On 28/07/07, Stef Mientki <[EMAIL PROTECTED]> wrote: > but I can;t find the answer ;-) > > As searching for the '$' sign doesn't work well in the help files, > I can not find out, where is the '$' sign used for. > > If I try to use it in names, > I get a compiler error, > so it probably has some sp

Re: IOS-style command line interface module?

2006-03-13 Thread David Wilson
Doh, I am indeed referring to the standard "cmd" module - thanks! To [EMAIL PROTECTED], the above module does what you describe. Thanks again, David. -- http://mail.python.org/mailman/listinfo/python-list

IOS-style command line interface module?

2006-03-11 Thread David Wilson
Hi folks, I seem to remember seeing a module some time in the distant past that provided an API for implementing Cisco IOS-like command line interfaces. I can't for the life of me find a reference to it on Google now. Does anyone know what I'm talking about? Thanks, David. -- http://mail.pyt

Re: Calling python scripts from C# programs

2005-09-22 Thread David Wilson
You should also be aware of IronPython, although it is not suitable for production use due to its reliance on a beta version of the .NET runtime. In some future time, IronPython will probably be the cleanest and simplest way to integrate Python with existing .NET code. http://www.ironpython.com/

Re: Looking for system/network monitoring tool written in Python

2005-09-22 Thread David Wilson
See http://pynms.sourceforge.net/ Also see Google. :) David. -- http://mail.python.org/mailman/listinfo/python-list

Re: python optimization

2005-09-15 Thread David Wilson
For the most part, CPython performs few optimisations by itself. You may be interested in psyco, which performs several heavy optimisations on running Python code. http://psyco.sf.net/ Defining a function inside a loop in CPython will cause a new function object to be created each and every time

Re: MySQLdb UPDATE does nothing

2005-09-15 Thread David Wilson
>> sql="UPDATE product_attribute SET index_column = "+str(index)+" WHERE id = >> "+str(record2[0]) >> .. >> cursor.execute(sql) To allow the DB-API adaptor to correctly take care of value conversion and SQL escaping for you, this should be written as: cursor.execute("UPDATE product_attribute SET

Re: Python in C integration and WxPython

2005-09-15 Thread David Wilson
It sounds like your C program and Python script are running under different interpreters. Your C program almost certainly is using a Python version that comes with Cygwin, while the script is probably using a native win32 Python that has wxPython installed. Assuming this is true, then compiling yo

Re: change extensions

2005-04-04 Thread David Wilson
Bob Then wrote: > how can i change all files from one extension to another within a direcory? This should work: import os def change_exts(suffix, new_suffix, dir_name): for name in os.listdir(dir_name): if name.endswith(suffix): old_pathname = os.path.join(dir_name, name)

Re: vi and python

2005-01-09 Thread David Wilson
km wrote: Is there a way to display inbuilt function syntax as the user starts typing a function name with 'Vi' editor in console mode? Hi there, Unfortunately due to the highly dynamic nature of Python, this is difficult to do reliably. It is one benefit that static typing, to a certain exte