[Tutor] Using time.localtime() and files

Raymond Hettinger python@rcn.com
Fri, 31 May 2002 11:51:30 -0400


Try this:

print '%s %s\n* %s' % (time.strftime('%Y-%m-%d'), user, change)


Raymond Hettinger


----- Original Message -----
From: "Chris Avery" <purplebo@babylonia.flatirons.org>
To: <tutor@python.org>
Sent: Friday, May 31, 2002 10:08 AM
Subject: [Tutor] Using time.localtime() and files


> Hi!  I'm writin a script that writes the date, user, and change that that
person did to a file called CHANGELOG.  This is for a school machine with
many student admins.  I need the file to look like this:
>
> YYYY-MM-DD user
> * change
>
> I know that I need to use time.localtime() and pickle, but I can't get the
date to write to the file correctly.
>
> Help!
> Thanks
>
> --
> +++++++++++++++++++
> Chris Avery, KC0KTH
> +++++++++++++++++++
>
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>