为什么argv有一个'v' [英] Why does argv have a 'v'
问题描述
我正在以新手程序员的身份学习Python.我已经看到了argv,就像在sys.argv中一样,我相信它也在其他语言中也使用过. "argv"中"v"的含义是什么?它代表什么意思,该术语起源于何处?
I am studying Python as a novice programmer. I have seen argv, as in sys.argv used and I believe it is used in other languages as well. What is the significance of the 'v' in 'argv'? What does it stand for and where does the term originate?
我希望这可以帮助我理解和记住"argv"的使用.
I am hoping this will help me understand and remember the use of "argv".
推荐答案
变量分别命名为argc
( argument count )和argv
( argument vector em> ),按照惯例,来自C.
The variables are named argc
(argument count) and argv
(argument vector) by convention, from C.
请注意,在Python中没有sys.argc
.您只需按照 fred-larson的指示使用len(sys.argv)
note that in Python there's no sys.argc
. You just use len(sys.argv)
as pointed fred-larson
这篇关于为什么argv有一个'v'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!