Sending string var with apply sends all chars as params!???

Emile van Sebille emile at fenx.com
Tue Jun 25 11:42:02 EDT 2002


Etienne
> value = apply(formatter,(str(value)))


Try passing in a tuple, eg:

value = apply(formatter,(str(value),))

>>> def fmt(*args):
...     print args
...
>>> s = '20020625140609'
>>> apply(fmt,s)
('2', '0', '0', '2', '0', '6', '2', '5', '1', '4', '0', '6', '0', '9')
>>> apply(fmt,(s,))
('20020625140609',)
>>>

--

Emile van Sebille
emile at fenx.com

---------




More information about the Python-list mailing list