(Replying to this list because my problem became 'user-level')
wxGTK changes the locale to match the system's locale, and wxPython's
startup code also changes the local so Python will match the C lib. So
it is probably being changed to a locale where ',' is the decimal
separator instead of '.'.
Yes, this seems to be the root of my problem because I'm using lt_LT.UTF-8
locale on this machine. That meens I need to modify my program not to use
it, but use some another language instead to get the 'normal' eval function.
I'm trying the following code:
class MyFrame(wx.Frame):
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, -1, title)
l = wxLocale()
l.Init(wxLANGUAGE_ENGLISH)
p = wx.Panel(self, -1)
b = wx.Button(p, -1, "Do It", (10,10))
print "Bad:", eval("-5.323")
print float("3.324")
But this doesn't help and 'flaot' requires '3,324' instead of '3.324'. Is it
possible to override system language inside my application? I need to use
float() and eval() with "." separator with the application on any system not
depending on it's locale. Thanks.
Martynas
···
On Sun, May 16, 2004 at 11:28:41AM -0700, Robin Dunn wrote:
--
The best way of learning is learning by doing.
http://mjoc.sig.lt