如何将int添加到argv

时间:2013-09-11 00:46:01

标签: 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

1 个答案:

答案 0 :(得分:1)

你没有。你是分开做的。

second = int(second)