Mailing List Archive

increment date present list of tuple by weeks python
Hi All


I have a list like this :-

[. ('7 May monday AM Neuropancreatic'), ('8 May tuesday PM Cardiovascular')]

how can i increment date in the above list for the next months on weekly
basis ?

[. ('7 May monday AM Neuropancreatic'),('14May monday AM
Neuropancreatic')('21 May monday AM Neuropancreatic')('28 May monday AM
Neuropancreatic'),
('8 May tuesday PM Cardiovascular'),('15 May monday AM
Neuropancreatic'),('22 May monday AM Neuropancreatic'),('29 May monday AM
Neuropancreatic')]


Thanks



--
Regards
Nikhil Verma
+91-958-273-3156
Re: increment date present list of tuple by weeks python [ In reply to ]
On 11/05/2012 10:55, Nikhil Verma wrote:
> Hi All
>
>
> I have a list like this :-
>
> [. ('7 May monday AM Neuropancreatic'), ('8 May tuesday PM Cardiovascular')]
>
> how can i increment date in the above list for the next months on weekly
> basis ?
>
> [. ('7 May monday AM Neuropancreatic'),('14May monday AM
> Neuropancreatic')('21 May monday AM Neuropancreatic')('28 May monday AM
> Neuropancreatic'),
> ('8 May tuesday PM Cardiovascular'),('15 May monday AM
> Neuropancreatic'),('22 May monday AM Neuropancreatic'),('29 May monday AM
> Neuropancreatic')]
>
>
> Thanks
>

See http://docs.python.org/library/time.html#time.strptime and it's
cousin strftime, and
http://docs.python.org/library/datetime.html#module-datetime date and
timedelta types.

--
Cheers.

Mark Lawrence.

--
http://mail.python.org/mailman/listinfo/python-list