Python equivalent of two Perl statements

Kemp Randy-W18971 Randy.L.Kemp at motorola.com
Fri Jul 20 11:52:37 EDT 2001


Thanks!  I will try that.

-----Original Message-----
From: Sean 'Shaleh' Perry [mailto:shalehperry at home.com]
Sent: Friday, July 20, 2001 10:37 AM
To: Kemp Randy-W18971
Cc: python-list at python.org
Subject: RE: Python equivalent of two Perl statements



On 20-Jul-2001 Kemp Randy-W18971 wrote:
> What is the equivalent of these Perl statements in Python?
> 
> $time = scalar(localtime);
> print "This FTP request started on $time \n";
> 

import time
now = time.ctime(time.time())
print now

time.time() returns seconds since the epoch, ctime() turns it into the
string
like perl does.  There are several other interesting time printing functions
in
the 'time' module.




More information about the Python-list mailing list