Home >Backend Development >Python Tutorial >python get command line parameters function

python get command line parameters function

高洛峰
高洛峰Original
2017-02-27 09:47:591533browse

Function to get command line parameters and quantity under perl.

import sys
print sys.argv
print len(sys.argv) #Number of parameters
print sys.argv[1] #First parameter
print sys. argv[2]
For more python related articles on getting command line parameter functions, please pay attention to the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn