什么是“argv",它有什么作用? [英] What is "argv", and what does it do?
本文介绍了什么是“argv",它有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
参数
这到底是什么!?
如果可以,请写一两行并解释它是如何工作的吗?
If you can, will you please write a line or two and explain how it works?
推荐答案
试试这个简单的程序,命名为 program.py
Try this simple program, name it as program.py
import sys
print sys.argv
并尝试执行
python program.py
python program.py a b c
python program.py hello world
注意现在 argv 是什么.
Note what is argv now.
这篇关于什么是“argv",它有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文