Wenn ich ein Skript mit Ipython im interaktiven Modus ausführen, ist die sys.argv
Argumentliste im interaktiven Teil der Ausführung anders als im Skript.sys.argv unterscheidet sich im interaktiven Modus in Ipython
Ist das ein Fehler, oder mache ich etwas falsch?
Danke!
[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']