I am trying to exit a python script without the appearance of an annoying error message:
Traceback (most recent call last):
File "<pyshell#27>", line 3, in <module>
sys.exit()
SystemExit
I tried a lot of things, but no one worked. Here is an example:
while True:
print "hi",
try:
sys.exit()
except SystemExit:
print "Exited"
NB: the solution should not be anywhere close to this code, it was just an example of what I tried
source
share