Re: sub-classing the types in the builtin module datetime

2007-08-15 Thread Michael Amrhein
Colin J. Williams wrote: > I wish to sub-class (if that's the right word) datetime and to use a > different signature for the constructor. > > The second part has gone smoothly, but it is difficult to access the > type's methods from the sub-class instance. > What's difficult? >>> from datetim

Re: Python IDE: great headache....

2006-03-14 Thread Michael Amrhein
Sullivan WxPyQtKinter schrieb: > IDLE is no longer satisfactory for me. Other IDEs make me very > confused. Really do not know which one to use. > > I use WinXP sp2 for current development. > > So far as I know, Eclipse + PyDev + PyDev Extension is perfect for > source code editing. Since I am re

Re: Do I need to convert string to integer in python?

2006-02-26 Thread Michael Amrhein
[EMAIL PROTECTED] schrieb: > Do I need to convert string to integer in python? or it will do it for > me (since dynamic type)? > > In my python script, I have this line: > x /= 10; > > when i run it, I get this error: > TypeError: unsupported operand type(s) for /=: 'unicode' and 'int' > > I

Re: representing physical units

2006-02-09 Thread Michael Amrhein
Russ schrieb: > I know that python packages are available for representing physical > units, but I am getting frustrated trying to find them and determine > which is the best. > > Rather than just using conventional dimensionless numbers with implicit > units, I would like to have a way to explici

Re: Natural Language Date Processing.

2006-02-09 Thread Michael Amrhein
Andrew Gwozdziewycz schrieb: >> You may take a look at http://labix.org/python-dateutil >> Have fun >> Michael >> > > Looks like it does a good job parsing dates, but doesn't seem to do > english dates. I found a javascript implementation of a few functions > that will probably be relatively easy

Re: Natural Language Date Processing.

2006-02-07 Thread Michael Amrhein
Andrew Gwozdziewycz schrieb: > I've been looking recently for date processing modules that can parse > dates in forms such as > "next week" or "6 days from next sunday". PHP has a function that will > do this called 'strtotime', > but I have not found a Python implementation. I've check the stan

Re: Fast generation of permutations

2006-01-25 Thread Michael Amrhein
Michael Amrhein schrieb: > Frode Øijord schrieb: >> Hi all, >> given a sequence of n elements i need to generate all possible >> permutations of length k <= n. >> >> I found an elegant way to do this recursively: >> >> def comb(items, n): >>

Re: Fast generation of permutations

2006-01-25 Thread Michael Amrhein
Frode Øijord schrieb: > Hi all, > given a sequence of n elements i need to generate all possible > permutations of length k <= n. > > I found an elegant way to do this recursively: > > def comb(items, n): > if n==0: yield [] > else: > for i in xrange(len(items)): > fo

Re: Determine the IP address of an eth interface

2006-01-19 Thread Michael Amrhein
billie wrote: > Hi all. I'm searching for a module that permits me to low-level interact > with ethernet interfaces of my system. > I would like to determine at least the first of the followings values: > > 1 - IP address assigned to the interface > 2 - subnet mask > 3 - default gateway > 4 - prim

Re: Why do Pythoneers reinvent the wheel?

2005-09-09 Thread Michael Amrhein
Stefano Masini schrieb: > On 8 Sep 2005 08:24:50 -0700, Fuzzyman <[EMAIL PROTECTED]> wrote: > >>What is pythonutils ? >>= >>ConfigObj - simple config file handling >>validate - validation and type conversion system >>listquote - string to list conversion >>StandOut - simple log