で対話モードにするとき異なっている私は、対話型モードでIpythonでスクリプトを実行すると、sys.argv
引数リストは、スクリプトよりも実行の対話的な部分で異なっています。sys.argvのはIpython
は、これはバグ、または私が何か間違ったことをやっていますか?
ありがとうございます!
[email protected]:~$ cat test.py
import sys
print(sys.argv)
temp = sys.argv
[email protected]:~$ ipython -i test.py -- foo bar
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
Type "copyright", "credits" or "license" for more information.
IPython 4.2.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
['/home/oskar/test.py', 'foo', 'bar']
In [1]: temp
Out[1]: ['/home/oskar/test.py', 'foo', 'bar']
In [2]: sys.argv
Out[2]: ['/usr/local/bin/ipython', '-i', 'test.py', '--', 'foo', 'bar']