ime('%Y_%m_%d %H_%M_%S.csv')
> >> '2008_05_07 12_30_22.csv'
> >> >>> datetime.today().strftime(u'%Y_%m_%d %H_%M_%S.csv')
> >> Traceback (most recent call last):
> >> File "", line 1, in
> >> TypeError
Tim Roberts wrote:
> I think that's a perfectly reasonable thing to expect. At the risk of
> over-generalization, there is no good reason why, by this point in time,
> all of the standard library routines that accept strings shouldn't also
> accept Unicode strings.
However, file(fname), open(fnam
p", "copyright", "credits" or "license" for more information.
>> >>> from datetime import datetime
>> >>> datetime.today().strftime('%Y_%m_%d %H_%M_%S.csv')
>> '2008_05_07 12_30_22.csv'
>> >>> date
n.
> >>> from datetime import datetime
> >>> datetime.today().strftime('%Y_%m_%d %H_%M_%S.csv')
> '2008_05_07 12_30_22.csv'
> >>> datetime.today().strftime(u'%Y_%m_%d %H_%M_%S.csv')
> Traceback (most recent call last):
> File
strftime('%Y_%m_%d %H_%M_%S.csv')
'2008_05_07 12_30_22.csv'
>>> datetime.today().strftime(u'%Y_%m_%d %H_%M_%S.csv')
Traceback (most recent call last):
File "", line 1, in
TypeError: strftime() argument 1 must be str, not unicode
--
http://mail.python.org/mailman/listinfo/python-list