Re: Figure out month number from month abbrievation

2006-04-13 Thread Fulvio
Alle 20:16, giovedì 13 aprile 2006, Fredrik Lundh ha scritto: > >>> locale.setlocale(locale.LC_ALL, "it_IT") > > 'it_IT' Thank you Great & kind explanation F -- http://mail.python.org/mailman/listinfo/python-list

Re: Figure out month number from month abbrievation

2006-04-13 Thread Fredrik Lundh
"Fulvio" wrote: > > but it also looks as if the meaning of the word "localized" isn't clear to > > you; if you changed the locale, those names will be translated > > Mine behave strangely. Linux localized for Italian, but Python (or its > calander is in english) Python defaults to the C locale, w

Re: Figure out month number from month abbrievation

2006-04-13 Thread Fulvio
Alle 04:41, giovedì 13 aprile 2006, Fredrik Lundh ha scritto: > but it also looks as if the meaning of the word "localized" isn't clear to > you; if you changed the locale, those names will be translated Mine behave strangely. Linux localized for Italian, but Python (or its calander is in english

Re: Figure out month number from month abbrievation

2006-04-12 Thread John Salerno
John Machin wrote: > You can answer such questions yourself very easily, e.g. in this case: > > >>> import calendar > >>> calendar.month_abbr > > >>> list(calendar.month_abbr) > ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', > 'Oct', 'Nov', 'Dec'] Ah thanks. I did try i

Re: Figure out month number from month abbrievation

2006-04-12 Thread Azolex
John Salerno wrote: > Bill wrote: > >> def month_number(monthabbr): >> """Return the month number for monthabbr; e.g. "Jan" -> 1.""" >> for index, day in enumerate(calendar.month_abbr): >> if day == monthabbr: >> return index >> >> which works well enough but isn't very

Re: Figure out month number from month abbrievation

2006-04-12 Thread John Machin
On 13/04/2006 7:02 AM, John Salerno wrote: > Bill wrote: > >> def month_number(monthabbr): >> """Return the month number for monthabbr; e.g. "Jan" -> 1.""" >> for index, day in enumerate(calendar.month_abbr): >> if day == monthabbr: >> return index >> >> which works wel

Re: Figure out month number from month abbrievation

2006-04-12 Thread John Salerno
Bill wrote: > def month_number(monthabbr): > """Return the month number for monthabbr; e.g. "Jan" -> 1.""" > for index, day in enumerate(calendar.month_abbr): > if day == monthabbr: > return index > > which works well enough but isn't very clever. I'm pretty new to >

Re: Figure out month number from month abbrievation

2006-04-12 Thread Christos Georgiou
On 12 Apr 2006 13:20:28 -0700, rumours say that "Bill" <[EMAIL PROTECTED]> might have written: >Hello -- >I'm parsing the output of the finger command, and was wondering >something...If I'm given a month abbrievation (such as "Jan"), what's >the best way to figure out the month number? Try impor

Re: Figure out month number from month abbrievation

2006-04-12 Thread Azolex
Bill wrote: > Hello -- > I'm parsing the output of the finger command, and was wondering > something...If I'm given a month abbrievation (such as "Jan"), what's > the best way to figure out the month number? > I see that there's > something called "month_abbr" in the calendar module. However, whe

Re: Figure out month number from month abbrievation

2006-04-12 Thread Fredrik Lundh
"Bill" wrote: > I'm parsing the output of the finger command, and was wondering > something...If I'm given a month abbrievation (such as "Jan"), what's > the best way to figure out the month number? I see that there's > something called "month_abbr" in the calendar module. However, when I > try

Figure out month number from month abbrievation

2006-04-12 Thread Bill
Hello -- I'm parsing the output of the finger command, and was wondering something...If I'm given a month abbrievation (such as "Jan"), what's the best way to figure out the month number? I see that there's something called "month_abbr" in the calendar module. However, when I try to do calendar.m