Re: Creating a list of Mondays for a year

2005-09-19 Thread Charles Krug
On Mon, 19 Sep 2005 12:10:04 GMT, Chris <[EMAIL PROTECTED]> wrote: > Thanks to everyone for your help! > > That fit the need perfectly. > > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] says... >> Is there a way to make python create a list of Mondays for a given year? >> >> For example,

Re: Creating a list of Mondays for a year

2005-09-19 Thread Chris
Thanks to everyone for your help! That fit the need perfectly. In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Is there a way to make python create a list of Mondays for a given year? > > For example, > > mondays = ['1/3/2005','1/10/2005','1/17/2005','1/24/2005', > '1/31/2005','2/7

Re: Creating a list of Mondays for a year

2005-09-18 Thread George Sakkis
"Peter Hansen" <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > "Chris" <[EMAIL PROTECTED]> wrote: > >>Is there a way to make python create a list of Mondays for a given year? > > > > Get the dateutil package (https://moin.conectiva.com.br/DateUtil): > > > > import dateutil.rrule as rrule > >

Re: Creating a list of Mondays for a year

2005-09-18 Thread Paul Rubin
Chris <[EMAIL PROTECTED]> writes: > Is there a way to make python create a list of Mondays for a given year? > mondays = ['1/3/2005','1/10/2005','1/17/2005','1/24/2005', > '1/31/2005','2/7/2005', ... ] This is pretty inefficient but it's conceptually the simplest: def mondays(year): from ca

Re: Creating a list of Mondays for a year

2005-09-18 Thread Peter Hansen
George Sakkis wrote: > "Chris" <[EMAIL PROTECTED]> wrote: >>Is there a way to make python create a list of Mondays for a given year? > > Get the dateutil package (https://moin.conectiva.com.br/DateUtil): > > import dateutil.rrule as rrule > from datetime import date > > mondays2005 = tuple(rrule

Re: Creating a list of Mondays for a year

2005-09-18 Thread [EMAIL PROTECTED]
Consider also dateutil written by Gustavo Niemeyer and found at: https://moin.conectiva.com.br/DateUtil >>> from dateutil.rrule import * >>> list(rrule(WEEKLY, byweekday=MO, dtstart=date(2005,1,1), >>> until=date(2005,12,31))) The library may be a little intimidating at first it is worth learnin

Re: Creating a list of Mondays for a year

2005-09-18 Thread George Sakkis
"Chris" <[EMAIL PROTECTED]> wrote: > Is there a way to make python create a list of Mondays for a given year? > > For example, > > mondays = ['1/3/2005','1/10/2005','1/17/2005','1/24/2005', > '1/31/2005','2/7/2005', ... ] Get the dateutil package (https://moin.conectiva.com.br/DateUtil): impor

Re: Creating a list of Mondays for a year

2005-09-18 Thread Peter Hansen
Chris wrote: > Is there a way to make python create a list of Mondays for a given year? > > For example, > > mondays = ['1/3/2005','1/10/2005','1/17/2005','1/24/2005', > '1/31/2005','2/7/2005', ... ] from datetime import date, timedelta def mondays(year): '''generate all days that are Mo

Re: Creating a list of Mondays for a year

2005-09-18 Thread skip
Chris> Is there a way to make python create a list of Mondays for a Chris> given year? For example, Chris> mondays = ['1/3/2005','1/10/2005','1/17/2005','1/24/2005', Chris> '1/31/2005','2/7/2005', ... ] How about: import datetime oneday = datetime.timedelta(days=1)

Creating a list of Mondays for a year

2005-09-18 Thread Chris
Is there a way to make python create a list of Mondays for a given year? For example, mondays = ['1/3/2005','1/10/2005','1/17/2005','1/24/2005', '1/31/2005','2/7/2005', ... ] -- http://mail.python.org/mailman/listinfo/python-list