Blocking the execution of a script

A

Angelo Secchi

Hi,
I would like Python to interrupt the execution of a script in case an if
condition turns out to be TRUE. What is the proper way to do that?

Thanks,
a.

--
========================================================
Angelo Secchi PGP Key ID:EA280337
========================================================
Current Position:
Graduate Fellow Scuola Superiore S.Anna
Piazza Martiri della Liberta' 33, Pisa, 56127 Italy
ph.: +39 050 883365
email: (e-mail address removed) www.sssup.it/~secchi/
========================================================

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFBHJ2ZigTT+OooAzcRAlkrAJ9GF9vXqUNBtN/mQFqOHtpxAL+6BgCcDbqW
by67ofbCJ7yc1ShZ6ayAb28=
=Xmnl
-----END PGP SIGNATURE-----
 
P

Peter van Kampen

Hi,
I would like Python to interrupt the execution of a script in case an if
condition turns out to be TRUE. What is the proper way to do that?

Thanks,
a.

import sys

if cond:
sys.exit(1)


Hth,

PterK
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top