Emacs + py-mode + tkinter problem

Discussion in 'Python' started by Tom Locke, Jul 3, 2003.

  1. Tom Locke

    Tom Locke Guest

    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.
     
    Tom Locke, Jul 3, 2003
    #1
    1. Advertising

  2. On 3 Jul 2003, Thomas Güttler <- 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'
     
    Karl =?iso-8859-1?q?Pfl=E4sterer?=, Jul 3, 2003
    #2
    1. Advertising

  3. Thomas Güttler <> 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
     
    Alexander Schmolck, Jul 3, 2003
    #3
  4. 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
     
    Fernando Perez, Jul 3, 2003
    #4
  5. Alexander Schmolck wrote:

    > Thomas Güttler <> 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
     
    Thomas =?ISO-8859-15?Q?G=FCttler?=, Jul 4, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John J Lee
    Replies:
    3
    Views:
    551
    bruno at modulix
    Dec 1, 2005
  2. Edward Loper
    Replies:
    0
    Views:
    526
    Edward Loper
    Aug 7, 2007
  3. Jeffrey Moss

    eruby mode emacs with mmm-mode

    Jeffrey Moss, Jul 6, 2005, in forum: Ruby
    Replies:
    1
    Views:
    188
    Alan Chen
    Jul 6, 2005
  4. PerlFAQ Server
    Replies:
    1
    Views:
    222
    Marc Girod
    Jan 8, 2011
  5. PerlFAQ Server
    Replies:
    0
    Views:
    181
    PerlFAQ Server
    Apr 12, 2011
Loading...

Share This Page