Re: [Idle-dev] Interruptable code?

2006-12-16 Thread Kurt B. Kaiser
"Douglas S. Blank" <[EMAIL PROTECTED]> writes: > I notice that in IDLE when running with -n (no processes) that: > while 1: 1 > > can be stopped with control+c, but: > while 1: None > > cannot. I realize that this is true because the second example doesn't > cause anything to be written

Re: [Idle-dev] Interruptable code?

2006-12-16 Thread Douglas S. Blank
On Sat, December 16, 2006 3:21 am, Kurt B. Kaiser said: [snip] > def func(): > while True: > if flist.pyshell.canceled: > break > > while True: func() > > (works w/o subprocess) Thanks! That will do it. >> - I can't use idle with sub processes (because I want to i

Re: [Idle-dev] Interruptable code?

2006-12-16 Thread Tal Einat
On 12/16/06, Douglas S. Blank <[EMAIL PROTECTED]> wrote: On Sat, December 16, 2006 3:21 am, Kurt B. Kaiser said: >> - I can't use idle with sub processes (because I want to interact with >> Tkinter in a single thread) > > If you run with the subprocess and construct Tkinter objects, they run i

Re: [Idle-dev] Interruptable code?

2006-12-16 Thread Douglas S. Blank
On Sat, December 16, 2006 10:15 am, Tal Einat said: [snip] > This always works for me: > > import thread > import Tkinter > root = Tkinter.Tk() > ... > thread.start_new_thread(root.mainloop, ()) > > This way you can even kill the mainloop without killing IDLE. > > Hooking onto IDLE's GUI mainloo