BEGINNER: converting integer to short month name?

Mike C. Fletcher mcfletch at rogers.com
Wed Apr 9 16:46:10 EDT 2003


MCollins at co.seminole.fl.us wrote:

>hi,
>  
>
...

>that works fine for the numerical month names.  now i'm trying to convert
>the numerical month into it's short month name equivalent to grab those
>files.
>
>i could always use a long if , elif, elif to do the job, but i was
>wondering if there was built-in function already capable of that.  i was
>just looking for something a little more elegant.
>
>any suggestions?
>

    [ 'Dec','Jan','Feb','Mar', ... ] [ the_month ]

or

    import calendar
    calendar.month_abbr[ the_month ]

HTH,
Mike

 
_______________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://members.rogers.com/mcfletch/








More information about the Python-list mailing list