Python does not let me format time.
eviltofu at rocketmail.com
Fri Apr 28 02:52:54 CEST 2000
In article <8eakhq$797$1 at nnrp1.deja.com>, Sindh <skodela at my-deja.com>
> Hi folks
> I have a file full of date, value pairs. Date is like MM/DD/YY. My
> problem is I want to format this file since it contains a few thousand
> lines of data , using python. I tried using string and time modules. I
> want to format the time value to a float which is returned by
> time.gmtime normally. I tried to split it and to use parts of it to make
> a tuple and to use time.mktime but it says illegal operation for
> data is:
> 03/11/98 abcd
> 03/12/98 efgh
> I split it to
> x=string.split(n,' ')
> which gave me x='03/11/98'
> Now I split it again by
> which gave a tuple of '03','11','98'
> Now I tried to make time as
use 0,0,0,0,0,0 for the rest of the tuple
> The problem is it says illegal operation for builtin. I tried to use the
> string val and int val as the arguments for mktime.
> Anyone with any helpful ideas!!
> If there is already a moduls to do the same , much helpful.
> A man needs to sleep for 36 hours a day atleast.
> Sent via Deja.com http://www.deja.com/
> Before you buy.
More information about the Python-list