terminate exectutioin in PythonWin

J

Jim

Hi all

1.Could someone tell me how to terminate execution in PythonWin?

2.Can anyone recommend a free development environment in which you can
save your workspace (e.g. open files, debugging breakpoints etc.)

Jim
 
L

Larry Bates

1) To exit any application:

import sys
sys.exit(0)

2) I'm not familiar with any of these development systems. I use
what comes with ActiveState's PythonWin. It does have debugging
breakpoints, etc.

Larry Bates
 
J

Jim

Larry said:
1) To exit any application:

import sys
sys.exit(0)

....



Thanks Larry.

Actually I meant how do I stop a program running that I have started in
the interpreter. If I get into an infinite loop I can't stop it without
qutting PythonWin.

Then I have to open all the files and re-insert breakpoints etc. :(

Jim
 
N

Neil Hodgson

Jim,
1.Could someone tell me how to terminate execution in PythonWin?

Use the "Break into running code" command on the context menu of the
PythonWin icon in the bottom right of the taskbar.

Neil
 
J

Jim

Neil said:
Jim,




Use the "Break into running code" command on the context menu of the
PythonWin icon in the bottom right of the taskbar.

Neil

Great thanks! PythonWin isn't hot on keyboard shortcuts but ironically
calls this a KeyboardInterrupt :|

Know any keyboard shortcuts for debug view? e.g. open it, run(debug),
step etc.

Jim
 
S

Steve Holden

Jim wrote:
[...]
Actually I meant how do I stop a program running that I have started in
the interpreter. If I get into an infinite loop I can't stop it without
qutting PythonWin.

Then I have to open all the files and re-insert breakpoints etc. :(

Jim

Look in the system tray! Right-mouse on the Python and select "break
into running program".

regards
Steve
 
J

Jim

Steve said:
Jim wrote:
[...]
Actually I meant how do I stop a program running that I have started
in the interpreter. If I get into an infinite loop I can't stop it
without qutting PythonWin.

Then I have to open all the files and re-insert breakpoints etc. :(

Jim


Look in the system tray! Right-mouse on the Python and select "break
into running program".

regards
Steve
D'oh. I didn't think of that.

Thanks

Jim
 
O

olsongt

D'oh. I didn't think of that.

Thanks

Jim

A little off-topic, but here's a little more fun with pythonwin. You
can spawn the debugging environment from a normal python script running
outside of pythonwin with:

import pywin.debugger;pywin.debugger.set_trace()

Also note that 'pywin.debugger.set_trace()' can be used anywhere if
you're trying to 'keep' breakpoints in the code without relying an an
IDE or project tracking them for you.
 
N

Neil Hodgson

Jim:
Great thanks! PythonWin isn't hot on keyboard shortcuts but ironically
calls this a KeyboardInterrupt :|

I don't think the keyboard can be accessed in this situation so the
icon is provided.
Know any keyboard shortcuts for debug view? e.g. open it, run(debug),
step etc.

No, I use PythonWin just as a console and prefer HAP Debugger
although it hasn't been updated for Python 2.4.
http://hapdebugger.sourceforge.net/

Neil
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,234
Messages
2,571,179
Members
47,811
Latest member
GregoryHal

Latest Threads

Top