473,387 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Blocking the execution of a script


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: se****@sssup.it www.sssup.it/~secchi/
================================================== ======

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

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

Jul 18 '05 #1
1 1394
In article <ma**************************************@python.o rg>, Angelo Secchi wrote:

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

--
Peter van Kampen
pterk -- at -- datatailors.com
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tanel | last post by:
Hello, I need to read a result of the first script (that takes some time to run) from the second script so that the first script doesn't block the second. Here is a short example. do_smth_else()...
4
by: Richard | last post by:
hi, I am using SQL SERVER 2000. Problem that i am facing is when ever I check locks in Enterprise Manager I find following blocking - : 1) sp_cursoropen;1 2) sp_cursorclose;1 3)...
23
by: David McCulloch | last post by:
QUESTION-1: How can I detect if Norton Internet Security is blocking pop-ups? QUESTION-2a: How could I know if a particular JavaScript function has been declared? QUESTION-2b: How could I...
38
by: Emmett | last post by:
I have a simple jacascript that randomizes the background of the top frame of my webpage http://www.duke.edu/~efn. For some reason, my Internet Explorer started blocking the background and...
2
by: Tash Robinson | last post by:
I have been searching and can not seem to find a good example of a working UDP client that listens, but does not block while waiting for data arrival. I am trying to write a client application...
7
by: Michi Henning | last post by:
Hi, I'm using a non-blocking connect to connect to a server. Works fine -- the server gets and accepts the connection. However, once the connection is established, I cannot retrieve either the...
7
by: Dave Hardy | last post by:
I have thread t1 . It spawns thread t2. I want to wait in thread t1 until the execution of thread t2 in completed. Bu t I do not want it to be a blocking wait since I want thread t1 to be...
5
by: Simon Knox | last post by:
Hi I have a web app that has a legitimate use for pop up windows. My web app is an insurance quoting app. I use the window.open method to display another aspx page so that the user can check...
4
by: Lunchtimemama | last post by:
I have a UI with a gallery of thumbnail image previews. The PictureBoxes are created and their Images are generated by a method which quickly retrieves the icon for the filetype. Worker threads...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.