当前位置:网站首页>sys. argv
sys. argv
2022-07-06 08:24:00 【Don't seek great wealth, just seek wealth to rival the country】
sys.argv Parameters can be obtained from the command line , Execute the script .
import os
import sys
root=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(root)
print("sys_test.argv: ",sys.argv)
print("sys_test.argv[0]: ",sys.argv[0])
print("sys_test.argv[1]: ",sys.argv[1])
print("sys_test.argv[2]: ",sys.argv[2])
print(len(sys.argv))
Console output :
C:\Users\jam96\PycharmProjects\all_module\sys_test>python a.py q w e r
sys_test.argv: ['a.py', 'q', 'w', 'e', 'r']
sys_test.argv[0]: a.py
sys_test.argv[1]: q
sys_test.argv[2]: w
5
1. from python hinder .py File count
2. from 0 Start counting
边栏推荐
- Fibonacci sequence
- hcip--mpls
- [2022 广东省赛M] 拉格朗日插值 (多元函数极值 分治NTT)
- NFT smart contract release, blind box, public offering technology practice -- contract
- Deep learning: derivation of shallow neural networks and deep neural networks
- CISP-PTE实操练习讲解
- 2. File operation - write
- Go learning notes (3) basic types and statements (2)
- 2022.02.13 - NC003. Design LRU cache structure
- C language - bit segment
猜你喜欢

根据csv文件某一列字符串中某个数字排序
![[MySQL] database stored procedure and storage function clearance tutorial (full version)](/img/27/e775e03b77c7195216bc50c5cbefb4.png)
[MySQL] database stored procedure and storage function clearance tutorial (full version)

Nft智能合约发行,盲盒,公开发售技术实战--合约篇

2. File operation - write

2022.02.13 - NC002. sort

NFT smart contract release, blind box, public offering technology practice -- jigsaw puzzle

The State Economic Information Center "APEC industry +" Western Silicon Valley will invest 2trillion yuan in Chengdu Chongqing economic circle, which will surpass the observation of Shanghai | stable

【刷题】牛客网面试必刷TOP101

Synchronized solves problems caused by sharing

Sanzi chess (C language)
随机推荐
JS select all and tab bar switching, simple comments
远程存储访问授权
Deep learning: derivation of shallow neural networks and deep neural networks
MFC sends left click, double click, and right click messages to list controls
[Yugong series] creation of 009 unity object of U3D full stack class in February 2022
Erc20 token agreement
灰度升级 TiDB Operator
Artcube information of "designer universe": Guangzhou implements the community designer system to achieve "great improvement" of urban quality | national economic and Information Center
Mobile Test Engineer occupation yyds dry goods inventory
2022.02.13 - NC004. Print number of loops
Configuring OSPF load sharing for Huawei devices
String to leading 0
Huawei cloud OBS file upload and download tool class
从 TiDB 集群迁移数据至另一 TiDB 集群
【MySQL】日志
Migrate data from CSV files to tidb
2022 Inner Mongolia latest water conservancy and hydropower construction safety officer simulation examination questions and answers
LDAP Application Section (4) Jenkins Access
Artcube information of "designer universe": Guangzhou implements the community designer system to achieve "great improvement" of urban quality | national economic and Information Center
Online yaml to CSV tool