Figure out month number from month abbrievation

John Salerno johnjsal at NOSPAMgmail.com
Wed Apr 12 17:20:36 EDT 2006


John Machin wrote:

> You can answer such questions yourself very easily, e.g. in this case:
> 
>  >>> import calendar
>  >>> calendar.month_abbr
> <calendar._localized_month instance at 0x00AE84E0>
>  >>> list(calendar.month_abbr)
> ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 
> 'Oct', 'Nov', 'Dec']

Ah thanks. I did try it first, but I didn't know to cast it to a list, 
so I was just getting the object.



More information about the Python-list mailing list