473,569 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Emacs + py-mode + tkinter problem

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
4 3339
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
Thomas Güttler <gu******@thoma s-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
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
Alexander Schmolck wrote:
Thomas Güttler <gu******@thoma s-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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2391
by: Wezzy | last post by:
Hi all, i've just seen the pydebug plugin for jEdit and my question is : is there something similar for emacs ? i'm looking for a debugger frontend, a very simple program, just set breakpoint, execute one line and show variables' values ty -- Ciao Fabio
5
2301
by: Darren Dale | last post by:
I am using Emacs Python mode, and my project involves reading large datafiles and processing large arrays. I have some code that reports the progress during these time consuming processes. It works fine from the dos shell, but I would really like to work entirely within Emacs. I have two questions: 1) Is it possible to have the *Python...
81
4646
by: julio | last post by:
Sorry but there is no another way, c# .net and mono are going to rip python, not because python is a bad lenguage, but because is to darn old and it refuses to innovate things, to fix wrong things, just because retarded backwards compatibility and because the python comunity and developers refuses to consider tools as being almost as important...
2
5003
by: Yuri Shtil | last post by:
Hi, I am trying to learn python and use the gud/pdb from emacs. The functionality that I am used to under gud/gdb and gud/perldb is missing, or I don't know how to make it work. Specifically: when I start pdb on a script file, the source does not show in an another window as it does with perldb and gdb. If I bring it up in an another...
0
1262
by: Andrew Markebo | last post by:
Argh.. How do I debug my python-code from the inside of emacs, throw some breakpoints? and fire up the session, check backtraces and so on? /Andy Experimenting I have come this far: I have put a pdb.bat in my path, containing:
12
12262
by: Rex Eastbourne | last post by:
Hi, I'm interested in running a Python interpreter in Emacs. I have Python extensions for Emacs, and my python menu lists "C-c !" as the command to run the interpreter. Yet when I run it I get the message "Spawning Child Process: invalid argument." What do I need to do/download to fix this? I read in a post in this group from a while...
5
2357
by: levander | last post by:
I've been using pdb under emacs on an Ubuntu box to debug python programs. I just upgraded from Ubuntu Edgy to Feisty and this combo has stopped working. Python is at 2.5.1 now, and emacs is at 21.41.1. It used to be I could just "M-x pdb RET pdb <script-nameRET" and be presented with a prompt where I could debug my script, as well as an...
4
2711
by: Paul Rudin | last post by:
I can't get the gdb fringe interaction functionality to work with either pdb or pydb. Any hints as to versions or incantations I should try? I have the emacs22 from debian unstable emacs-snapshot-gtk package fwiw.
14
2644
by: jmDesktop | last post by:
Hi, I'm trying to learn Python. I using Aquamac an emac implementation with mac os x. I have a program. If I go to the command prompt and type pythong myprog.py, it works. Can the program be run from within the editor or is that not how development is done? I ask because I was using Visual Studio with C# and, if you're familiar, you just...
2
1873
by: Iain Dalton | last post by:
In Emacs, using run-python, import urllib urllib.urlopen('http://www.google.com/') results in this traceback: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.5/urllib.py", line 82, in urlopen
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7678
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7982
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5222
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3656
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.