BEGINNER: converting integer to short month name?

Mike C. Fletcher mcfletch at
Wed Apr 9 22:46:10 CEST 2003

MCollins at wrote:


>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
>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 ]


    import calendar
    calendar.month_abbr[ the_month ]


  Mike C. Fletcher
  Designer, VR Plumber, Coder

More information about the Python-list mailing list