adding current date to a file name in a python script

Sybren Stuvel sybrenUSE at
Sun Jan 29 10:11:54 CET 2006

markryde at enlightened us with:
> myFile = '/work/output1'
> myFile = myFile.join(today)
> myFile = myFile.join(".txt")

join does something completely different. You want:

myFile = '/work/output1/%s.txt' % today

The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself? 
                                             Frank Zappa

More information about the Python-list mailing list