Program Termination

Program Execution

  • Programs run until there are no more statements to execute.

  • Usually this is signaled by EOF

  • Can press Control-D (Unix) or Control-Z (Windows) to exit interactive interpreter

Forcing Termination

  • Raising an exception:
     >>> raise SystemExit
  • Calling exit manually:
     import system
     system.exit(0)
<<< O'Reilly OSCON 2000, Introduction to Python, Slide 9
July 17, 2000, beazley@cs.uchicago.edu
>>>