[wxPython] Problems with the Installation of wxPython

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] Problems with the Installation of wxPython

Mahmoud Nikbakht
After downloading the packages wxGTK-2.1.13-0.i386.rpm and
wxPython-2.1.13-1.i386.rpm and following the usual way of
installation of RPMs, I have tried to test the code of the
first tutorial on the home page of wxPython. The result is
documented in the following:

Before pressing the "Return" key:

>>> from wxPython.wx import *
>>> class MyApp(wxApp):
         def OnInit(self):
             frame = wxFrame(NULL, -1, "Hello from wxPython")
             frame.Show(true)
             self.SetTopWindow(frame)
             return true




After pressing the "Return" key:

>>> from wxPython.wx import *
>>> Exception in Tkinter callback
Traceback (innermost last):
  File "/usr/lib/python1.5/lib-tk/Tkinter.py", line 764, in __call__
    return apply(self.func, args)
  File "/usr/doc/packages/python/Tools/idle-0.5/PyShell.py", line 546,
in enter_callback
    self.auto.auto_indent(event)
  File "/usr/doc/packages/python/Tools/idle-0.5/AutoIndent.py", line
256, in newline_and_indent_event
    lno = index2line(text.index('insert'))
  File "/usr/doc/packages/python/Tools/idle-0.5/AutoIndent.py", line
483, in index2line
    return int(float(index))
ValueError: invalid literal for float(): 11.0
class MyApp(wxApp):
         def OnInit(self):
             frame = wxFrame(NULL, -1, "Hello from wxPython")
             frame.Show(true)
             self.SetTopWindow(frame)
             return true


>>>

After then IDLE doesn't work properly. By pressing the "Return" key one
gets
instead of a new line the following error message
>>>Exception in Tkinter callback
Traceback (innermost last):
  File "/usr/lib/python1.5/lib-tk/Tkinter.py", line 764, in __call__
    return apply(self.func, args)
  File "/usr/doc/packages/python/Tools/idle-0.5/PyShell.py", line 546,
in enter_callback
    self.auto.auto_indent(event)
  File "/usr/doc/packages/python/Tools/idle-0.5/AutoIndent.py", line
256, in newline_and_indent_event
    lno = index2line(text.index('insert'))
  File "/usr/doc/packages/python/Tools/idle-0.5/AutoIndent.py", line
483, in index2line
    return int(float(index))
ValueError: invalid literal for float(): 34.0



>>>

Can somebody help me to fix this problem?

Best regards,

M. Nikbakht
Email: [hidden email]


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] Problems with the Installation of wxPython

Fredrik Lundh-3
Mahmoud Nikbakht <[hidden email]> wrote:
> After downloading the packages wxGTK-2.1.13-0.i386.rpm and
> wxPython-2.1.13-1.i386.rpm and following the usual way of
> installation of RPMs, I have tried to test the code of the
> first tutorial on the home page of wxPython

(is wxPython really supposed to work from inside
IDLE?  running two different user interface toolkits
at the same time tends to be a great way to mess
things up completely).

> ValueError: invalid literal for float(): 11.0

looks as if the wxPython library is screwing up the
locale setting.  Python extensions aren't supposed
to do that...

...

to see if this works outside IDLE, just put your
code in a file named "test.py" (or whatever), and
run it from the ordinary shell.

</F>


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] Problems with the Installation of wxPython

Robin Dunn

> Mahmoud Nikbakht <[hidden email]> wrote:
> > After downloading the packages wxGTK-2.1.13-0.i386.rpm and
> > wxPython-2.1.13-1.i386.rpm and following the usual way of
> > installation of RPMs, I have tried to test the code of the
> > first tutorial on the home page of wxPython
>
> (is wxPython really supposed to work from inside
> IDLE?  running two different user interface toolkits
> at the same time tends to be a great way to mess
> things up completely).

No, they starve each other's event loops...


> > ValueError: invalid literal for float(): 11.0
>
> looks as if the wxPython library is screwing up the
> locale setting.  Python extensions aren't supposed
> to do that...

I think it's actually gtk, or at least burried somewhere in wxWindows.  I'll
add it to my list to dig into this and see if it can be turned off.


--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!




_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users