Parameterübergabe mit argv

http://learnpythonthehardway.org/book/ex13.html

from sys import argv
 
script, first, second, third = argv
 
print "The script is called:", script
print "Your first variable is:", first
print "Your second variable is:", second
print "Your third variable is:", third

Das Script *MUSS* drei Argumente haben. Mit dem Scriptnamen sind es dann vier :)

> python script.py argument1 argument2 argument3
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information