Python,这个语法是否正确

时间:2015-11-22 22:31:25

标签: python command arguments line

#filename= sys.argv[1]

#topic= sys.argv[2]

# a function --> aggregator(filename,topic).Can you then call the function in main() as follows

aggregator(sys.argv[1],sys.argv[2])

当你在pycharm终端上输入prompt..python aggregator.py something.txt 它会产生错误

File "aggregator.py", line 68, in main
    aggregator(sys.argv[1],sys.argv[2])
IndexError: list index out of range

有人可以告诉我为什么吗?提前致谢

0 个答案:

没有答案