First page Back Continue Last page Overview Image

Benutzung von os._exit()

import os

def f():

print("Whatever!")

os._exit(1)

print("Main program!")

try:

f()

except:

print("exception caught")

Main program!

Whatever!

import os

def f():

print("Whatever!")

os._exit(1)

print("Main program!")

f()

Main program!

Whatever!

Exit to the system

with specified status,

without normal exit

processing.