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,
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
"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
> >
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
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
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
"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
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
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)
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
10 matches
Mail list logo