[gtk] troubles with string -> float conversion

Steve Purcell stephen_purcell at yahoo.com
Wed Apr 18 05:54:38 EDT 2001


L'Ordinateur du Particulier wrote:
> i have some problems with string to float conversion in python
> 
> before importing gtk module, the string "6.6" is converted into float
> without problem, but after the gtk module has been imported,
> the syntax "6.6" is invalid, python's waiting "6,6" ...
> 
> the float() function seems to have been overwritten !?
> 
> is there a way to choose which decimal separator to use ?


You need to tell us what versions of Python and PyGTK you're using.

The 'gtk' module appears to do some locale initialisation; maybe it interacts
with the global locale if you're using Python 2.x. You would need to look
at the C source code for the _gtk module because that's where the local
initialisation is done.

-Steve

-- 
Steve Purcell, Pythangelist
Get testing at http://pyunit.sourceforge.net/
Any opinions expressed herein are my own and not necessarily those of Yahoo




More information about the Python-list mailing list