Re: Time travel - how to simplify?

2017-11-18 Thread Peter Otten
#x27;, > 12: 'Z' > } > > where key is a month. > Now i want to get certain number of months. Say, i need 3 months duration > starting from any month in dict. > > so if i start @ 7th: > my_choice =7 > for mnth, value in fut_suffi

Re: Time travel - how to simplify?

2017-11-18 Thread Andrew Z
writes: > > > > > Now i want to get certain number of months. Say, i need 3 months > duration > > > starting from any month in dict. > > > > > > so if i start @ 7th: > > > my_choice =7 > > > for mnth, value in fut_suffix: > >

Re: Time travel - how to simplify?

2017-11-14 Thread Rick Johnson
7 > > for mnth, value in fut_suffix: > > if my_choice >= mnth > ># life is great > > but if : > > my_choice = 12 then my "time travel" becomes pain in the neck.. > > The ‘itertools’ library in the Python standard library > https://

Re: Time travel - how to simplify?

2017-11-14 Thread Ben Finney
Ben Finney writes: > import itertools > > month_values = sorted(list(fut_suffix.keys())) > month_cycle = itertools.cycle(month_values) > > month_choice = 7 > three_months_starting_at_choice = [] > while len(three_months_starting_at_choice) < 3: > this_month = next(

Re: Time travel - how to simplify?

2017-11-14 Thread Ben Finney
Andrew Z writes: > Now i want to get certain number of months. Say, i need 3 months duration > starting from any month in dict. > > so if i start @ 7th: > my_choice =7 > for mnth, value in fut_suffix: > if my_choice >= mnth ># life is great > but if :

Time travel - how to simplify?

2017-11-13 Thread Andrew Z
ain number of months. Say, i need 3 months duration starting from any month in dict. so if i start @ 7th: my_choice =7 for mnth, value in fut_suffix: if my_choice >= mnth # life is great but if : my_choice = 12 then my "time travel" becomes pain in the neck.. And as such

Re: Time travel - how to simplify?

2017-11-13 Thread Andrew Z
;Z' > } > > where key is a month. > Now i want to get certain number of months. Say, i need 3 months duration > starting from any month in dict. > > so if i start @ 7th: > my_choice =7 > for mnth, value in fut_suffix: > if my_choice >= mnth &

Re: Time travel

2009-11-17 Thread greg
Lee Merrill wrote: And I can't do arithmetic, it is actually about 3600--never mind! Don't feel too bad. Obviously Guido nipped back to March 8 2008 in his time machine and fixed the problem, making it *look* like you can't do arithmetic. Time travel often leads to embarrass

Re: Time travel

2009-11-17 Thread Lee Merrill
And I can't do arithmetic, it is actually about 3600--never mind! On Nov 17, 10:37 am, Lee Merrill wrote: > I'm seeing an anomaly in the python time function on March 9, 2008 > (the "spring foward" time): > > >>> time.mktime((2008, 3, 9, 2, 59, 59, 0, 0, -1)) > 1205049599.0 > >>> time.mktime((20

Time travel

2009-11-17 Thread Lee Merrill
I'm seeing an anomaly in the python time function on March 9, 2008 (the "spring foward" time): >>> time.mktime((2008, 3, 9, 2, 59, 59, 0, 0, -1)) 1205049599.0 >>> time.mktime((2008, 3, 9, 3, 0, 0, 0, 0, -1)) 1205046000.0 Does anyone have an idea as to what might cause a 4000 seconds backwards jum