Re: calculate difference between two timestamps [newbie]

2011-12-18 Thread nukeymusic
On 18 dec, 13:58, Lie Ryan wrote: > On 12/18/2011 10:43 PM, Peter Otten wrote: > > > > > > > > > > > nukeymusic wrote: > > >> On 17 dec, 12:20, "Günther Dietrich"  wrote: > >>> nukeymusic  wrote: > >>>> I'm

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 > > inconvenie

Re: calculate difference between two timestamps [newbie]

2011-12-18 Thread nukeymusic
On 18 dec, 13:58, Lie Ryan wrote: > On 12/18/2011 10:43 PM, Peter Otten wrote: > > > > > > > > > > > nukeymusic wrote: > > >> On 17 dec, 12:20, "Günther Dietrich"  wrote: > >>> nukeymusic  wrote: > >>>> I'm

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

2011-12-18 Thread nukeymusic
On 18 dec, 13:39, Lie Ryan 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'

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 k

Re: calculate difference between two timestamps [newbie]

2011-12-18 Thread nukeymusic
On 17 dec, 12:20, "Günther Dietrich" wrote: > nukeymusic wrote: > >I'm trying to calculate the difference in seconds between two > > [...] > > >>> import datetime > >>> date1 = datetime.datetime.strptime("Dec-13-09:47:12", "

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 "", line 1, in TypeError: an integer is required struct_dat

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 repl