ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

exit(0) in python 3.3
Posted by vitux 24 Feb 2014 02:24
if i use exit(0) or analogs in Python 3.3 programs, it gets runtime error, why does it happens, and how can I avoid this problem?
Re: exit(0) in python 3.3
Using exit([arg]) you're raising SystemExit exception.
If you don't want that (which usually is the case), use

import os
os._exit(1)

instead (actually, this is receipt for Python 2.x, maybe it is a bit different in 3.x)