Python 2.7 如何将int添加到argv

Python 2.7 如何将int添加到argv,python-2.7,argv,Python 2.7,Argv,如何将“int”添加到此代码中,以便三者中至少有一个必须是整数 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

如何将“int”添加到此代码中,以便三者中至少有一个必须是整数

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

你没有。你要分开做

second = int(second)

你能换个说法吗?你说的加法是什么意思?如果争论是整数,那么你可以按照@Ignacio Vazquez Abrams的建议去做。除此之外,我不明白你的问题