victor a écrit :
or if u want explicit exit of program then use:
import sys
sys.exit(1)
or
raise SystemExit, 'message'
There is also the (not recommanded - see docs, but it exists)
os._exit(n) function.
A+
Laurent.
--
http://mail.python.org/mailman/listinfo/python-list
or if u want explicit exit of program then use:
import sys
sys.exit(1)
or
raise SystemExit, 'message'
Dan wrote:
bruce bedouglas at earthlink.net posted:
perl has the concept of die. does python have anything
similar. how can a python app be stopped?
I see this sort of statement a
bruce bedouglas at earthlink.net posted:
perl has the concept of die. does python have anything
similar. how can a python app be stopped?
I see this sort of statement a lot in Perl:
open(FH, myfile.txt) or die (Could not open file);
I've no idea why you're asking for the Python
On 3/07/2006 2:27 PM, bruce wrote:
hi...
perl has the concept of die.
does python have anything similar. how can a
python app be stopped?
the docs refer to a sys.stop.. but i can't find anything else... am i
missing something...
Inter alia, sys.exit() and a functional Shift key.
--
Wow, so many people with the same solution... where's the creativity
folks?
Whenever sys.exit() doesn't work for me, I find that a good solid thump
on the side of the computer case with a large mallet tends to do the
job. And there's always threatening the computer with a degaussing gun!
--
[EMAIL PROTECTED] [EMAIL PROTECTED] writes:
Wow, so many people with the same solution... where's the creativity
folks?
Whenever sys.exit() doesn't work for me, I find that a good solid thump
on the side of the computer case with a large mallet tends to do the
job. And there's always
[bruce]
perl has the concept of die. does python have anything similar. how can a
python app be stopped?
the docs refer to a sys.stop.
Python docs? Doubt it ;-)
but i can't find anything else... am i missing something...
import sys
print sys.exit.__doc__
exit([status])
Exit the
bruce [EMAIL PROTECTED] wrote:
hi...
perl has the concept of die. does python have anything similar. how can a
python app be stopped?
the docs refer to a sys.stop.. but i can't find anything else... am i
missing something...
import sys
sys.exit()
Alex
--
bruce wrote:
hi...
perl has the concept of die. does python have anything similar. how can a
python app be stopped?
the docs refer to a sys.stop.. but i can't find anything else... am i
missing something...
thanks
-bruce
What you want is sys.exit()
See:
bruce [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
hi...
perl has the concept of die. does python have anything similar. how can
a
python app be stopped?
the docs refer to a sys.stop.. but i can't find anything else... am i
missing something...
thanks
-bruce
(From the
10 matches
Mail list logo