LoginSignup
0
1

More than 5 years have passed since last update.

python -Sでexit()を殺す

Last updated at Posted at 2018-10-16
PS C:\Users\takey\Desktop\myspace\workspace> python -S
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32
>>> exit()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'exit' is not defined
>>>

コマンドラインと環境 -S

-S(原文)
site モジュールの import と、そのモジュールが行なっていた site ごとの sys.path への操作を無効にします。後に site を明示的に import しても、これらの操作は実行されません (実行したい場合は、 site.main() を呼び出してください)。

>>> import site
>>> exit()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'exit' is not defined
>>> site.main()
>>> exit()
PS C:\Users\takey\Desktop\myspace\workspace>
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1