python-mode.el and wxPython app

Alexander V. Voinov avv at quasar.ipa.nw.ru
Tue May 4 13:52:31 EDT 1999


Alex Rice wrote:

> Hi, I'm using python-mode 3.90, Emacs 20.3.1 (win32) and Python 1.5.1
> Can't get my GUI app to display when I C-c C-c it from within Emacs.
>
> Here is what I am doing:
>
> C-c C-! to start Python interpreter buffer
> C-c C-c in my source code buffer
> Then I see this in python buffer:
>
>  Python 1.5.1 (#0, Apr 13 1998, 20:22:04) [MSC 32 bit (Intel)] on win32
>  Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>  >>> ## working on region in file d:/tmp/python--248317Wgx...
>  starting main()...
>
> Then my app never appears.

Same here.

In the doc on python-mode one reads:
  "Execute the the region in a Python interpreter.
The region is first copied into a temporary file (in the directory
`py-temp-directory').  If there is *no* Python interpreter shell
running, this file is executed synchronously using
`shell-command-on-region'.  If the program is long running, *use an
optional \\[universal-argument]* to run the command asynchronously in
its own buffer.

So, do *not* launch a Python subshell in emacs but use C-u 1 C-c C-c
instead in your source buffer.
When it is run asynchonously you will see all your stdout in
*Python-output* during your app execution. I hacked the corresponding piece
in python-mode to make it run always asynchronously.
I do not put the patch here because the version I use is not a latest one.

May we ask Barry to make that behaviour (i.e. asynchronous running of
Python scripts) a default one?
E.g. analogously to compilation mode?

Alexander






More information about the Python-list mailing list