parsing a date string

2005-03-06 Thread MikeyG
Hi, I have a date string in the ctime() format ('Sat Mar 5 10:38:07 2005') and I want to know how long ago that was in whole days. So far I have: import time import datetime age = (datetime.date.fromtimestamp(time.mktime(time.strptime(date.strip( - datetime.date.today()).days Which is an

Re: python -i (interactive environment)

2005-03-06 Thread MikeyG
Joe wrote: When you run "python -i scriptname.py" after the script completes you left at the interactive command prompt. Is there a way to have this occur from a running program? In other words can I just run scriptname.py (NOT python -i scriptname.py) and inside of scriptname.py I decide that I

Re: Variable Variable

2005-03-20 Thread MikeyG
Premshree Pillai wrote: On Sat, 19 Mar 2005 04:35:47 -0500, Leif K-Brooks <[EMAIL PROTECTED]> wrote: Tanteauguri wrote: Hi List, is there in python a variable variable like in PHP ($$var)? What I want to do is something like that: pc=["a","b","c"] for i in pc: i = anyclass() a.shutdown() b.updat