By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,017 Members | 1,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,017 IT Pros & Developers. It's quick & easy.

Emacs + py-mode + tkinter problem

P: n/a
Hi All,

I'm having trouble with the python shell within emacs. It's hanging when I
use tkinter. Setup is:

Windows XP
emacs 21.3
py-mode 4.6

Recipe:
From a python-mode buffer, launch the python shell (C-c !), then in the
shell
import Tkinter
root = Tkinter.Tk()
1+2


And that's all folks. I get precisely one prompt after creating the root,
and then it hangs.

I've had a trawl around and it seems a few have run into this, but so far no
fix.

One tip was try running python with -u, but then I get syntax errors with
anything I type - seems like a CR/LF issue.

Help! :(

Tom.
Jul 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 3 Jul 2003, Thomas Güttler <- gu******@thomas-guettler.de wrote:
the interactive prompt from a terminal. Since I am quite happy
I would like to konw why you want the python interpreter in emacs?


Because it's much more convenient if you needn't leave the editor.
Editing is also a lot more comfortable.
KP

--
Der wahre Weltuntergang ist die Vernichtung des Geistes, der andere hängt von
dem gleichgiltigen Versuch ab, ob nach der Vernichtung des Geistes noch eine
Welt bestehen kann.
Karl Kraus 'Untergang der Welt durch schwarze Magie'
Jul 18 '05 #2

P: n/a
Thomas Güttler <gu******@thomas-guettler.de> writes:
Tom Locke wrote:
Hi All,

I'm having trouble with the python shell within emacs. It's hanging when I
use tkinter. Setup is:

Windows XP
emacs 21.3
py-mode 4.6

Recipe:
From a python-mode buffer, launch the python shell (C-c !), then in the
shell


Sorry, I don't know an answer since I only start
the interactive prompt from a terminal. Since I am quite happy
I would like to konw why you want the python interpreter in emacs?


While I can't speak for the OP, how about:

- uhm, how do you get code into your interactive session? In python mode you
can run selected code on a keypress (even if its indentation doesn't start
at 0), whereas last time I looked, cut and pasting of multiline code didn't
work *at all* for a stand-alone python shell (because the interactive python
shell insists on extra newlines after statements)

- debugger integration like automatically landing in the offending source code
on exceptions and being able to walk through the code corresponding to the
traceback (try C-c -)

- to use a real editor, not just for editing code but in the interactive
session, too (instead of the crippled readline interface). Ever tried
comint-previous-matching-input-from-input on M-p? Better than cursor-up, no?
Isearching your output can also be quite useful (and M-z etc. also happen to
work, because you're using emacs, not something that feels a bit like it).

Maybe too many people are happy with too little (essentially
edit/run-whole-program/debug cycles a la C, plus maybe using python
interactively as a calculator or to look up documenation). If I had time I'd
write a tutorial on using ipython from within emacs for (I think) much more
effective interactive development. As it is I still haven't found the time for
a reply to a post by David Abrahams on the topic.

'as

Jul 18 '05 #3

P: n/a
Alexander Schmolck wrote:

Maybe too many people are happy with too little (essentially
edit/run-whole-program/debug cycles a la C, plus maybe using python
interactively as a calculator or to look up documenation). If I had time I'd
write a tutorial on using ipython from within emacs for (I think) much more
effective interactive development.


.... me cheers in corner, while I know I've also fallen behind answering people's
recent questions on ipython ;) Ah, real work...

best,

f

Jul 18 '05 #4

P: n/a
Alexander Schmolck wrote:
Thomas Güttler <gu******@thomas-guettler.de> writes:
Tom Locke wrote:
> Hi All,
>
> I'm having trouble with the python shell within emacs. It's hanging
> when I use tkinter. Setup is:
>
> Windows XP
> emacs 21.3
> py-mode 4.6
>
> Recipe:
> From a python-mode buffer, launch the python shell (C-c !), then in the
> shell
Sorry, I don't know an answer since I only start
the interactive prompt from a terminal. Since I am quite happy
I would like to konw why you want the python interpreter in emacs?

Maybe too many people are happy with too little (essentially
edit/run-whole-program/debug cycles a la C, plus maybe using python
interactively as a calculator or to look up documenation).
Yes, maybe. I am used to
1. edit with emacs
2. press Alt-TAB
3. in xterm arrowUp return
4. maybe stacktrace --> emacs: goto-line (c-g) goto [1]

If I had time
I'd write a tutorial on using ipython from within emacs for (I think) much
more effective interactive development. As it is I still haven't found the
time for a reply to a post by David Abrahams on the topic.


Please announce it on python.announce

thomas

Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.