Discussion:
Problems with Tkinter based scripts under emacs...
Brian Kelley
2002-02-15 18:25:32 UTC
Permalink
I'm having problems with emacs on win95 when running a python script
that invokes Tkinter. I'm using the bash shell under emacs, and
python-mode, so that I can start up an interpreter which appears in a
comint buffer and issue commands. Theres no problem with regular
python scripts, and its a nice environment for edit-run-debugging.
I've just started using Tkinter and I find the following: The script
runs fine, but when I quit the application, the shell just hangs and I
don't get the >>> prompt back. I end up having to kill the process and
restart the interpreter.
Actually I'm not sure whether this is specifically an emacs issue.
I think this is more likely a Windows issue. Emacs also doesn't seem to
like to run wxPython in shell mode either. My guess is that on windows,
the standard gui programs fiddle with the stdin/stdout and stderr pipes
which gets emacs fairly confused.

This problem doesn't seem to occur on unix using the same toolkits and
emacs.

It's not free but the WING IDE seems to fix some of these problems under
windows, take a look at the feature list here
http://archaeopteryx.com/wingide/features
Everything works just fine in the DOS command line shell, but this is
so annoying to use! Any hints about setting up emacs or idle to cope
with Tkinter would be much appreciated.
The solution I use for debugging with Tkinter type ctrl-C ! in the
source window to open up a shell and then type ctrl-C ctrl-C to run the
source. This allows print statements and exceptions to be viewable at
run time. The caveat is that the shell hangs when I leave Tk so the
only benefit is the real time print statements.


Brian Kelley
Rod Stephenson
2002-02-15 10:53:37 UTC
Permalink
I'm having problems with emacs on win95 when running a python script
that invokes Tkinter. I'm using the bash shell under emacs, and
python-mode, so that I can start up an interpreter which appears in a
comint buffer and issue commands. Theres no problem with regular
python scripts, and its a nice environment for edit-run-debugging.

I've just started using Tkinter and I find the following: The script
runs fine, but when I quit the application, the shell just hangs and I
don't get the >>> prompt back. I end up having to kill the process and
restart the interpreter.

Actually I'm not sure whether this is specifically an emacs issue. I
find a similar thing happens when I use idle - after running a Tkinter
based script the shell window no longer responds, though I can
continue to reload the scripts after editing from the editor window
using the menus or keyboard accelerators. There is some discussion in
the FAQ on not using Tkinter with pythonWin.

Everything works just fine in the DOS command line shell, but this is
so annoying to use! Any hints about setting up emacs or idle to cope
with Tkinter would be much appreciated.

Loading...