Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

increment date present list of tuple by weeks python

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


varma.nikhil22 at gmail

May 11, 2012, 2:55 AM

Post #1 of 2 (206 views)
Permalink
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


breamoreboy at yahoo

May 11, 2012, 3:14 AM

Post #2 of 2 (185 views)
Permalink
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

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.