Re: calculate difference between two timestamps [newbie]

2011-12-18 Thread nukeymusic
On 17 dec, 12:20, Günther Dietrich gd.use...@spamfence.net wrote: nukeymusic nukeymu...@gmail.com wrote: I'm trying to calculate the difference in seconds between two [...] import datetime date1 = datetime.datetime.strptime(Dec-13-09:47:12, %b-%d-%H:%M:%S) date2

how to run python-script from the python promt? [absolute newbie]

2011-12-18 Thread nukeymusic
How can I load a python-script after starting python in the interactive mode? I tried with load 'myscript.py' myscript.py myscript but none of these works, so the only way I could work further until now was copy/paste line per line of my python-script to the interactive mode prompt I do know how

Re: how to run python-script from the python promt? [absolute newbie]

2011-12-18 Thread nukeymusic
On 18 dec, 13:39, Lie Ryan lie.1...@gmail.com wrote: On 12/18/2011 10:00 PM, nukeymusic wrote: How can I load a python-script after starting python in the interactive mode? I tried with load 'myscript.py' myscript.py myscript but none of these works, so the only way I

Re: calculate difference between two timestamps [newbie]

2011-12-18 Thread nukeymusic
On 18 dec, 13:58, Lie Ryan lie.1...@gmail.com wrote: On 12/18/2011 10:43 PM, Peter Otten wrote: nukeymusic wrote: On 17 dec, 12:20, Günther Dietrichgd.use...@spamfence.net  wrote: nukeymusicnukeymu...@gmail.com  wrote: I'm trying to calculate the difference in seconds between

Re: calculate difference between two timestamps [newbie]

2011-12-18 Thread nukeymusic
On 18 dec, 16:01, Peter Otten __pete...@web.de wrote: nukeymusic wrote: thanks and also thanks to all the others who were so kind to help me out with my first python-script. I tested your alternatives and they work, the only a minor inconvenience is that the first line of the inputfile

Re: calculate difference between two timestamps [newbie]

2011-12-18 Thread nukeymusic
On 18 dec, 13:58, Lie Ryan lie.1...@gmail.com wrote: On 12/18/2011 10:43 PM, Peter Otten wrote: nukeymusic wrote: On 17 dec, 12:20, Günther Dietrichgd.use...@spamfence.net  wrote: nukeymusicnukeymu...@gmail.com  wrote: I'm trying to calculate the difference in seconds between

calculate difference between two timestamps [newbie]

2011-12-17 Thread nukeymusic
I'm trying to calculate the difference in seconds between two timestamps, but I'm totally stuck: date1=Dec-13-09:47:12 date2=Dec-13-09:47:39 diff=datetime.date(date2)-datetime.date(date1) Traceback (most recent call last): File stdin, line 1, in module TypeError: an integer is required

replacing timestamps in file [newbie]

2011-12-14 Thread nukeymusic
I have a file which has the data in the following format: Dec-13-09:46:45 21.4 +4.76442190E-01 8.135530E-06 1.553691E+00 Dec-13-09:47:12 21.4 +4.76439120E-01 8.135839E-06 1.553726E+00 Dec-13-09:47:39 21.4 +4.76427260E-01 8.136261E-06 1.553853E+00 . . the first field is a timestamp, I'd like to