Emacs + py-mode + tkinter problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom Locke

    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
    [color=blue][color=green][color=darkred]
    >>> import Tkinter
    >>> root = Tkinter.Tk()
    >>> 1+2[/color][/color][/color]

    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.


  • Karl Pflästerer

    #2
    Re: Emacs + py-mode + tkinter problem

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

    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'

    Comment

    • Alexander Schmolck

      #3
      Re: Emacs + py-mode + tkinter problem

      Thomas Güttler <guettler@thoma s-guettler.de> writes:
      [color=blue]
      > Tom Locke wrote:
      >[color=green]
      > > 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[/color]
      >
      > 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?
      >[/color]

      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

      Comment

      • Fernando Perez

        #4
        Re: Emacs + py-mode + tkinter problem

        Alexander Schmolck wrote:

        [color=blue]
        > 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.[/color]

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

        best,

        f

        Comment

        • Thomas Güttler

          #5
          Re: Emacs + py-mode + tkinter problem

          Alexander Schmolck wrote:
          [color=blue]
          > Thomas Güttler <guettler@thoma s-guettler.de> writes:
          >[color=green]
          >> Tom Locke wrote:
          >>[color=darkred]
          >> > 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[/color]
          >>
          >> 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?[/color][/color]
          [color=blue]
          > 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).[/color]

          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]

          [color=blue]
          > 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.[/color]

          Please announce it on python.announce

          thomas

          Comment

          Working...