On Oct 17, 9:59 pm, Harlin Seritt <[EMAIL PROTECTED]> wrote:
> Is there a module that can pull str values for say the last 3 months?
> Something like:
>
> print lastMonths(3)
>
> ['Sep', 'Aug', 'Jul']

You should take a look at the 'datetime' module.

You can get the current month:
datetime.datetime.now().month

And a list of all abbreviated month names:
[datetime.datetime(1900, i + 1, 1).strftime('%b') for i in range(12)]

>From there, it shouldn't be too tricky to construct the list of months
you want.

--
Paul Hankin

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

Reply via email to