problem with locale
Just van Rossum
just at xs4all.nl
Mon Mar 4 06:46:17 EST 2002
In article <a5vlnp$mmk$1 at news.tpi.pl>,
"marcin andrzejewski" <m.andrzejewski at dmz.com.pl> wrote:
> everything works fine in IDLE, but when running as script, i 've got
> following error:
>
> import locale
> locale.setlocale(locale.LC_ALL, '')
> a= locale.format ('%.2f',-100000.236,1)
>
> Traceback (most recent call last):
> File "locale.py", line 1, in ?
> import locale
> File "locale.py", line 2, in ?
> locale.setlocale(locale.LC_ALL, '')
> AttributeError: 'module' object has no attribute 'setlocale'
> >Exit code: 1
>
> what's wrong ?
I think your script is called locale.py: Python will find it before the
"real" locale.py is found when importing.
Just
More information about the Python-list
mailing list