Re: time module

2015-11-08 Thread Marko Rauhamaa
input/ldompel...@casema.nl: > Yes, I would like seconds since start of program. > Can I not doing something like time()=0 only this gives an error. Here: class MyReckoning: def __init__(self): self.the_beginning = time.time() def time(self): return ti

Re: time module

2015-11-08 Thread input/ldompeling
gt; > > hi, > > > > I like to have a function that prints time in seconds. > > I am looking for something for example that seconds count from zero. > > I search the internet for time module in python but could not found anathing > > usefull. > > >

Re: time module

2015-11-07 Thread Cameron Simpson
On 07Nov2015 21:27, input/ldompel...@casema.nl wrote: I like to have a function that prints time in seconds. I am looking for something for example that seconds count from zero. I search the internet for time module in python but could not found anathing usefull. Here: https

time module

2015-11-07 Thread input/ldompeling
hi, I like to have a function that prints time in seconds. I am looking for something for example that seconds count from zero. I search the internet for time module in python but could not found anathing usefull. Has someone an example for it. Thanks

Re: time module vs. datetime module: plain language for beginners

2015-03-27 Thread Ian Kelly
On Fri, Mar 27, 2015 at 6:31 PM, Jinghui Niu wrote: > On Wednesday, March 25, 2015 at 2:17:03 PM UTC-7, Jinghui Niu wrote: >> I am learning python programming. One thing that gives me a lot of confusion >> is the division of labours between the time module and the datetime modu

Re: time module vs. datetime module: plain language for beginners

2015-03-27 Thread Jinghui Niu
On Wednesday, March 25, 2015 at 2:17:03 PM UTC-7, Jinghui Niu wrote: > I am learning python programming. One thing that gives me a lot of confusion > is the division of labours between the time module and the datetime module. > > As it turns out to be, time module is not only abou

Re: time module vs. datetime module: plain language for beginners

2015-03-25 Thread Mark Lawrence
On 25/03/2015 23:49, Ian Kelly wrote: On Wed, Mar 25, 2015 at 3:16 PM, Jinghui Niu wrote: I am learning python programming. One thing that gives me a lot of confusion is the division of labours between the time module and the datetime module. As it turns out to be, time module is not only

Re: time module vs. datetime module: plain language for beginners

2015-03-25 Thread Ian Kelly
On Wed, Mar 25, 2015 at 3:16 PM, Jinghui Niu wrote: > I am learning python programming. One thing that gives me a lot of confusion > is the division of labours between the time module and the datetime module. > > As it turns out to be, time module is not only about time, it's

Re: time module vs. datetime module: plain language for beginners

2015-03-25 Thread Steven D'Aprano
On Thu, 26 Mar 2015 08:16 am, Jinghui Niu wrote: > I am learning python programming. One thing that gives me a lot of > confusion is the division of labours between the time module and the > datetime module. > > As it turns out to be, time module is not only about time, it

time module vs. datetime module: plain language for beginners

2015-03-25 Thread Jinghui Niu
I am learning python programming. One thing that gives me a lot of confusion is the division of labours between the time module and the datetime module. As it turns out to be, time module is not only about time, it's about date too. And datetime doesn't natively support timezone, y

Python2.4 on ARM-Linux "import time module fails"

2010-08-25 Thread Ajeet Yadav
Hi, I cross-compiled Python2.4 for ARM (Linux 2.6.30) in order to run autotest-client-xxx on my ARM target. When I run autotest on ARM target I get "ImportError: No module named time" Which package I need to install to add support for time module. # bin/autotest samples/filesystem

Required help on python-time module

2008-08-20 Thread Pradeep Kumar
I am a newbie to python even mobile side also. I am using openmoko device, there I installed stripped down python from feed path's and I need tzset() of time module for my application but when running my application.  time.tzset() at above line getting "no  attribute tzset()  for mo

Re: Question on time module

2008-06-27 Thread subhabrata . iisc
This problem is solved with time.gmtime [EMAIL PROTECTED] wrote: > Dear Members of the group, > I have one function > def sum1(n): > a1=5 > a2=6 > a3=a1+a2 > a4=a3+8 > print "The First sum is" > print a3 > print "The Second sum is" > print a4 > > Now

Question on time module

2008-06-26 Thread subhabrata . iisc
Dear Members of the group, I have one function def sum1(n): a1=5 a2=6 a3=a1+a2 a4=a3+8 print "The First sum is" print a3 print "The Second sum is" print a4 Now, I want to do it in a way, a4 is calculated after a given time interval of a3 -this is eas

Re: time module methods give an am or pm value ?

2008-06-09 Thread dj
On Jun 7, 9:40 am, Scott David Daniels <[EMAIL PROTECTED]> wrote: > dj wrote: > > Hello again, > > > Does anyone know which method in the time module will generate and am > > or pm ? > > If none of the method will do this for me. Can I produce the value

Re: time module methods give an am or pm value ?

2008-06-09 Thread dj
On Jun 7, 9:24 am, "Mark Tolonen" <[EMAIL PROTECTED]> wrote: > "dj" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > Hello again, > > > Does anyone know which method in the time module will generate and am >

Re: time module methods give an am or pm value ?

2008-06-07 Thread Scott David Daniels
dj wrote: Hello again, Does anyone know which method in the time module will generate and am or pm ? If none of the method will do this for me. Can I produce the value on my own ? Any suggestions ? Read up about strftime (a function, not a method). Generally, if you know you'll be

Re: time module methods give an am or pm value ?

2008-06-07 Thread Mark Tolonen
"dj" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello again, Does anyone know which method in the time module will generate and am or pm ? If none of the method will do this for me. Can I produce the value on my own ? Any suggestions ? from time import * st

Re: time module methods give an am or pm value ?

2008-06-07 Thread dj
Hello again, Does anyone know which method in the time module will generate and am or pm ? If none of the method will do this for me. Can I produce the value on my own ? Any suggestions ? -- http://mail.python.org/mailman/listinfo/python-list

Re: time module question - time zones

2008-05-21 Thread Eric Wertman
Sorry, my time zone is +4, not minus 4, which means that something else is causing my source data to be in the future. I still do need to understand where the time routines determine the time zone offset, so I can be sure I'm passing around the neutral value. Thanks! On Wed, May 21, 2008 at 12:

time module question - time zones

2008-05-21 Thread Eric Wertman
I tend to deal with dates a lot in different formats and places... typically I'll convert them to a time tuple with strptime(), and pass them around like that before I need to write them back out. One set of time/dates I'm getting are in UTC, but the string doesn't say that specifically. So I do

Re: subtract dates with time module

2008-04-02 Thread barronmo
Thanks for the help everyone. I ended up with the following: def OBweeks(ptID): qry = 'SELECT short_des FROM problems WHERE patient_ID = %s;' % (ptID) results = EMR_utilities.getAllData(qry) for items in results: r = re.search('\d\d\d\d-\d\d-\d\d', str(items))

Re: subtract dates with time module

2008-03-27 Thread John Machin
barronmo wrote: > I'm trying to get the difference in dates using the time module rather > than datetime because I need to use strptime() to convert a date and > then find out how many weeks and days until that date. datetime.datetime.strptime was introduced in Python 2.5; what ve

Re: subtract dates with time module

2008-03-27 Thread Diez B. Roggisch
barronmo wrote: > I'm trying to get the difference in dates using the time module rather > than datetime because I need to use strptime() to convert a date and > then find out how many weeks and days until that date. I'm a beginner > so any help would be appreciated.

Re: subtract dates with time module

2008-03-26 Thread Gabriel Genellina
En Wed, 26 Mar 2008 20:47:45 -0300, barronmo <[EMAIL PROTECTED]> escribió: > I'm trying to get the difference in dates using the time module rather > than datetime because I need to use strptime() to convert a date and > then find out how many weeks and days until that date.

subtract dates with time module

2008-03-26 Thread barronmo
I'm trying to get the difference in dates using the time module rather than datetime because I need to use strptime() to convert a date and then find out how many weeks and days until that date. I'm a beginner so any help would be appreciated. Here is the code: def OBweeks(ptID)

Re: Time module is not behaving.

2008-03-26 Thread Jeff Lofaro
Yep that does it. Thanks Gary. - Original Message From: Gary Herron <[EMAIL PROTECTED]> To: jjlofaro <[EMAIL PROTECTED]> Cc: python-list@python.org Sent: Wednesday, 26 March, 2008 2:49:55 AM Subject: Re: Time module is not behaving. jjlofaro wrote: > Hi > > I&

Re: Time module is not behaving.

2008-03-25 Thread Gary Herron
jjlofaro wrote: > Hi > > I'm just getting myself going again on Python and would appreciate any > help. > > My install of Python seems to have some difficulty loading and using > the time module in a script. Strange thing is that if I start another > instance of Py

Time module is not behaving.

2008-03-25 Thread jjlofaro
Hi I'm just getting myself going again on Python and would appreciate any help. My install of Python seems to have some difficulty loading and using the time module in a script. Strange thing is that if I start another instance of Python I can type in my program manually/interactively a

Re: My 'time' module is broken, unsure of cause

2007-08-23 Thread Gary Herron
lways gets output. I searched Gentoo's bugzilla > but > can not see anything relevant. I rebuilt python but the behavior recurs. I am > unsure if the issue is with Python, Gentoo, or perhaps with the underlying > lib (presumably glibc) that Python uses for the time module.

Re: My 'time' module is broken, unsure of cause

2007-08-23 Thread darren kirby
quoth the Calderone: > > [EMAIL PROTECTED]:~$ echo "print '40:42:0'" > time.py > [EMAIL PROTECTED]:~$ python > Python 2.4.3 (#2, Oct 6 2006, 07:52:30) > [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >

Re: My 'time' module is broken, unsure of cause

2007-08-23 Thread Will Maier
On Thu, Aug 23, 2007 at 11:22:55AM -0600, darren kirby wrote: > Python 2.4.4 (#1, Aug 23 2007, 10:51:29) > [GCC 4.1.2 (Gentoo 4.1.2)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import time > 40:42:0 > >>> now = time.time() > Traceback (most recent call

Re: My 'time' module is broken, unsure of cause

2007-08-23 Thread Jean-Paul Calderone
ute 'time' > >Notice the '40:42:0' that always gets output. I searched Gentoo's bugzilla but >can not see anything relevant. I rebuilt python but the behavior recurs. I am >unsure if the issue is with Python, Gentoo, or perhaps with the underlying >lib (presuma

My 'time' module is broken, unsure of cause

2007-08-23 Thread darren kirby
ng relevant. I rebuilt python but the behavior recurs. I am unsure if the issue is with Python, Gentoo, or perhaps with the underlying lib (presumably glibc) that Python uses for the time module. This is working fine on another machine (also 2.4.4, GCC 3.4.6, Gentoo Hardened). Anyone seen

RE: Bug in Time module, or in my understanding?

2007-08-02 Thread Hamilton, William
> From: Joshua J. Kugler > > I am getting results like these with the time module: > > >>> import time > >>> int(time.mktime(time.strptime('2007-03-11 02:00:00', '%Y-%m-%d %H:%M > %S'))) > 1173610800 > >>> int(time.mktime(

Re: Bug in Time module, or in my understanding?

2007-08-01 Thread Joshua J. Kugler
On Wednesday 01 August 2007 14:49, Jay Loden wrote: > Hope some of this helps It did, thanks! j -- Joshua Kugler Lead System Admin -- Senior Programmer http://www.eeinternet.com PGP Key: http://pgp.mit.edu/  ID 0xDB26D7CE -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug in Time module, or in my understanding?

2007-08-01 Thread Joshua J. Kugler
On Wednesday 01 August 2007 14:45, Paul Boddie wrote: > Well, I think that if you inspect the result of strptime, you'll see > that the last element of the time "tuple" - in fact, the tm_isdst > member of a time "structure" - is set to -1: > time.strptime('2007-03-11 02:00:00', '%Y-%m-%d %H:%

Re: Bug in Time module, or in my understanding?

2007-08-01 Thread Jay Loden
Joshua J. Kugler wrote: > I am getting results like these with the time module: > >>>> import time >>>> int(time.mktime(time.strptime('2007-03-11 02:00:00', '%Y-%m-%d %H:%M > %S'))) > 1173610800 >>>> int(time.mktime(time.s

Re: Bug in Time module, or in my understanding?

2007-08-01 Thread Paul Boddie
Joshua J. Kugler wrote: > I am getting results like these with the time module: > > >>> import time > >>> int(time.mktime(time.strptime('2007-03-11 02:00:00', '%Y-%m-%d > >>> %H:%M:%S'))) > 1173610800 > >>> i

Bug in Time module, or in my understanding?

2007-08-01 Thread Joshua J. Kugler
I am getting results like these with the time module: >>> import time >>> int(time.mktime(time.strptime('2007-03-11 02:00:00', '%Y-%m-%d %H:%M %S'))) 1173610800 >>> int(time.mktime(time.strptime('2007-03-11 03:00:00', '%Y-%m-%

Re: Bug in time module - %z works in perl, not in python?

2007-02-22 Thread Paul Boddie
On 22 Feb, 17:29, [EMAIL PROTECTED] wrote: > On Feb 21, 9:50 pm, [EMAIL PROTECTED] wrote: > > > On Feb 21, 6:17 pm, [EMAIL PROTECTED] wrote: > ... > > > 2007-02-21 21:15:58 EST+ (iso localtime, python) > > Seems to be a bug. I can duplicate the > > problem here (Python 2.4.3, Red Hat Desktop

Re: Bug in time module - %z works in perl, not in python?

2007-02-22 Thread bwooster47
On Feb 21, 9:50 pm, [EMAIL PROTECTED] wrote: > On Feb 21, 6:17 pm, [EMAIL PROTECTED] wrote: ... > > 2007-02-21 21:15:58 EST+ (iso localtime, python) > Seems to be a bug. I can duplicate the > problem here (Python 2.4.3, Red Hat Desktop release 4). I searched the bug database, found this iss

Re: Bug in time module - %z works in perl, not in python?

2007-02-21 Thread attn . steven . kuo
On Feb 21, 6:17 pm, [EMAIL PROTECTED] wrote: > Following python code prints out incorrect UTC Offset - the python > docs say that %z is not fully supported on all platforms - but on > Linux Fedora FC5, perl code works and python does not - is this a bug > or is this expected behavior? For a EST tim

Bug in time module - %z works in perl, not in python?

2007-02-21 Thread bwooster47
Following python code prints out incorrect UTC Offset - the python docs say that %z is not fully supported on all platforms - but on Linux Fedora FC5, perl code works and python does not - is this a bug or is this expected behavior? For a EST timezone setup, Perl prints correct -0500, while Python

Re: inaccuracy in the time module

2006-09-04 Thread alf
Paul Rubin wrote: > alf <[EMAIL PROTECTED]> writes: > >> >>> t=time() >> >>> mktime(gmtime(t))-t >>17999.680048942566 >>why there is a difference? > > > time() is a floating point number with fractional seconds. > gmtime()'s resolution is one second. thx, got it now. replacing with "t=round(tim

Re: inaccuracy in the time module

2006-09-04 Thread Paul Rubin
alf <[EMAIL PROTECTED]> writes: > >>> t=time() > >>> mktime(gmtime(t))-t > 17999.680048942566 > why there is a difference? time() is a floating point number with fractional seconds. gmtime()'s resolution is one second. -- http://mail.python.org/mailman/listinfo/python-list

inaccuracy in the time module

2006-09-04 Thread alf
Hi, can someone explane this: >>> from time import * >>> timezone 18000 >>> t=time() >>> mktime(gmtime(t))-t 17999.680048942566 why there is a difference? -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: time module precision

2005-01-10 Thread Peter Hansen
[EMAIL PROTECTED] wrote: Peter Hansen wrote: _Why_ do you want to wait such brief amounts of time? What I am trying to do is sending binary data to a serial port. Since the device attached to the port cannot handle a continous in-flow of data, I need to make an artificial tiny delay in-between data

Re: time module precision

2005-01-10 Thread janeaustine50
Peter Hansen wrote: > [EMAIL PROTECTED] wrote: > > So the problem (waiting tens to hundreds of us without busy looping) > > still remains... > > That's actually not a "problem", it's your solution > to a problem. Can you describe the _real_ problem, what > you are trying to do? _Why_ do you want

Re: time module precision

2005-01-09 Thread Bengt Richter
On 9 Jan 2005 03:09:27 -0800, [EMAIL PROTECTED] wrote: [...] > >What I want to do is waiting(not busy-delaying) for a few tens to >hundreds of microseconds in some threads. The closet solution I got is >using windows QueryPerformanceCounter (in Python, time.clock) with busy >looping checking if we

Re: time module precision

2005-01-09 Thread Tim Peters
[Tim Peters] >> Python's time.sleep() calls the Win32 API Sleep() function on >> Windows. All behavior is inherited from the latter. See MS's docs: >> >> >> [EMAIL PROTECTED] > Oh, after a short research, I

Re: time module precision

2005-01-09 Thread Peter Hansen
[EMAIL PROTECTED] wrote: So the problem (waiting tens to hundreds of us without busy looping) still remains... That's actually not a "problem", it's your solution to a problem. Can you describe the _real_ problem, what you are trying to do? _Why_ do you want to wait such brief amounts of time? I

Re: time module precision

2005-01-09 Thread janeaustine50
Tim Peters wrote: [snip] > Python's time.sleep() calls the Win32 API Sleep() function on Windows. > All behavior is inherited from the latter. See MS's docs: > > Oh, after a short research, I found that tim

Re: time module precision

2005-01-08 Thread Tim Peters
[Jane Austine] > What is the precision (and accuracy) of time module on a Windows XP > machine? There are many functions in the time module. You shouldn't assume that any two have similar behavior (because, in fact, they may not). > threading module depends on time module so it&#

time module precision

2005-01-08 Thread Jane Austine
What is the precision (and accuracy) of time module on a Windows XP machine? threading module depends on time module so it's precision(and accuracy) is up to time module's. | for i in xrange(1000): |time.sleep(0.001) This sleeps for awhile, which means 0.001 sec is not ignored. On