Re: adding current date to a file name in a python script

2006-01-29 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I am trying to add the current date to a file name in python script > like thus: > > import os > import sys > import rpm > import time > import datetime > > today = datetime.date.today() > print "The date is", today > myFile = '/work/output1' > myFile = myFile.join(today

Re: adding current date to a file name in a python script

2006-01-29 Thread Sybren Stuvel
[EMAIL PROTECTED] 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 Sybren -- The problem with the world is stupidity. Not saying there should b

adding current date to a file name in a python script

2006-01-29 Thread markryde
Hello, I am trying to add the current date to a file name in python script like thus: import os import sys import rpm import time import datetime today = datetime.date.today() print "The date is", today myFile = '/work/output1' myFile = myFile.join(today) myFile = myFile.join(".txt") print "myF