python get command line parameters function

高洛峰
Release: 2017-02-27 09:47:59
Original
1363 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!