파이썬 종료하기 quit()

1 개요[ | ]

Python quit(), exit()
파이썬 quit(), exit()
quit()
import sys
sys.exit(0)
import os
os._exit(1)

2 예시[ | ]

root@localhost:~# cat hello.py 
print('hello')
quit()
print('world')
root@localhost:~# python3 hello.py 
hello
root@localhost:~# echo $?
0
root@localhost:~# cat hello255.py 
print('hello')
quit(255)
print('world')
root@localhost:~# python3 hello.py 
hello
root@localhost:~# echo $?
255

3 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}