Best way to convert a list into function call arguments?

2005-05-05 Thread bwooster47
I'm a newcomer to python - what is the best way to convert a list into a function call agruments? For example: list = (2005, 5, 5) date = datetime.date( list ) fails with: TypeError: function takes exactly 3 arguments (1 given) I assumed that since Python allows multiple assignments per stateme

Safe eval, or how to get list from string

2005-05-13 Thread bwooster47
I've to use ConfigParser. It returns values that are exactly in the config file, so get string variables like: int1 with quotes and characers: "42" this is easy to convert to int: realint = int(int1) I've read the tutorial, and the FAQ, and not sure if I missed it, but other than calling eval (wh

Re: Safe eval, or how to get list from string

2005-05-13 Thread bwooster47
> http://twistedmatrix.com/users/moshez/unrepr.py > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/364469 Thanks, this helps - but I was looking at using no additional modules, or using something that came bundled in with python 2.3 I just discovered mx.Tools.NewBuiltins It has somethin

distutils, install_data and RPM distributions

2005-05-25 Thread bwooster47
I have a simple python script that I need to create a kit for, and it has one config file. This is for Unix only, and very restricted use, so here's my relevant setup.py: setup(., scripts=['myscript.py'], data_files=[('/etc', ['myscript.cfg'])],...) My problem is that when I repeatedly

datetime - easy way to make it use local timezone?

2007-02-21 Thread bwooster47
Is there an easy way to have an automatically constructed local time zone tzinfo object be used with datetime? Following code shows the problem - the time module works fine mostly (%Z works, but %z does not, but that may be the way it is), uses # The following python code outputs: note the time()

Bug in time module - %z works in perl, not in python?

2007-02-21 Thread bwooster47
Following python code prints out incorrect UTC Offset - the python docs say that %z is not fully supported on all platforms - but on Linux Fedora FC5, perl code works and python does not - is this a bug or is this expected behavior? For a EST timezone setup, Perl prints correct -0500, while Python

Re: Bug in time module - %z works in perl, not in python?

2007-02-22 Thread bwooster47
On Feb 21, 9:50 pm, [EMAIL PROTECTED] wrote: > On Feb 21, 6:17 pm, [EMAIL PROTECTED] wrote: ... > > 2007-02-21 21:15:58 EST+ (iso localtime, python) > Seems to be a bug. I can duplicate the > problem here (Python 2.4.3, Red Hat Desktop release 4). I searched the bug database, found this iss