How to debug Python program with GUI (Tkinter)?

Discussion in 'Python' started by Davy, Nov 28, 2007.

  1. Davy

    Davy Guest

    Hi all,

    How to debug Python program with GUI, especially Tkinter? My debug
    environment is PythonWin.

    For example, when I single step in the program, the step will go to
    mainloop() and always loop there. How can I know where the program is
    processed?

    Any suggestions are welcome!
    Best regards,
    Davy
     
    Davy, Nov 28, 2007
    #1
    1. Advertising

  2. Davy wrote:

    > Hi all,
    >
    > How to debug Python program with GUI, especially Tkinter? My debug
    > environment is PythonWin.
    >
    > For example, when I single step in the program, the step will go to
    > mainloop() and always loop there. How can I know where the program is
    > processed?


    You can't - the mainloop is written in C. You need to set breakpoints in the
    command-handlers of your interest.

    Diezv
     
    Diez B. Roggisch, Nov 28, 2007
    #2
    1. Advertising

  3. Davy

    Nir Guest

    On Nov 28, 11:18 am, Davy <> wrote:
    > Hi all,
    >
    > How todebugPython program with GUI, especially Tkinter? Mydebug
    > environment is PythonWin.
    >
    > For example, when I single step in the program, the step will go to
    > mainloop() and always loop there. How can I know where the program is
    > processed?
    >
    > Any suggestions are welcome!
    > Best regards,
    > Davy



    Try Winpdb
    http://www.digitalpeers.com/pythondebugger/

    With Winpdb you can pause (break into) and inspect the state of the
    Python script even if it is doing some C code.

    Nir
     
    Nir, Dec 5, 2007
    #3
    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. Mike C. Fletcher
    Replies:
    3
    Views:
    995
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Oct 12, 2003
  2. ulysses
    Replies:
    4
    Views:
    787
    Werner Schiendl
    Oct 22, 2003
  3. Beinan Li
    Replies:
    0
    Views:
    68
    Beinan Li
    Jan 4, 2014
  4. Jerry Hill
    Replies:
    0
    Views:
    75
    Jerry Hill
    Jan 4, 2014
  5. Beinan Li
    Replies:
    0
    Views:
    70
    Beinan Li
    Jan 4, 2014
Loading...

Share This Page