GTK breaks float! (related to "float does not parse 0.00000E+00")

Remco Gerlich scarblac-spamtrap at pino.selwerd.nl
Tue Jun 6 09:01:32 EDT 2000


Paolo Redaelli wrote in comp.lang.python:
> Look at the this short program:
> 
> =======
> #!/usr/bin/env python
> 
> s = "0.000000E+00"
> print "Converting",s," into: ", float(s)
> print "Importing gtk"
> 
> import GDK
> from gtk import *
> from gnome.ui import *
> import GdkImlib
> print "Converting",s," into: ", float(s)
> =======
> Here's its output:
> =======
> [paolo at aldebaran paolo]$ python float.py
> Converting 0.000000E+00  into:  0.0
> Importing gtk
> Converting 0.000000E+00  into: 
> Traceback (innermost last):
>   File "float.py", line 11, in ?
>     print "Converting",s," into: ", float(s)
> ValueError: invalid literal for float(): 0.000000E+00
> =======
> 
> The only lesson I can extract from it is that GTK breaks float!

It still looks to me like gtk or gnome.ui is overwriting float, because of
your from module import * statements. What does "print repr(float)" say?

(I don't have gtk, can't test this myself).

-- 
Remco Gerlich,  scarblac at pino.selwerd.nl
This space intentionally left blank.



More information about the Python-list mailing list