Been researching this for a while now and can't seem to find a solution. I'm starting to think that there may not be one. Note, I am still self teaching myself Python, so I may be missing an easy solution.
Here's the line:
time = time.strftime("%Y%m%d-%H%M%S")
sys.stdout = open('/home/username/logfilesgohere/%s', % time 'w')
I'm trying to make the file that stdout writes to reflect the current timestamp as per the time variable. This would be easy to do in bash with backticks but I'm a python newb. Also to note that I'm using this in my fabfile for fabric.
sys.stdout = open('/home/username/logfilesgohere/%s'% time,'w')