当前位置:网站首页>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
边栏推荐
- 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
- 升级 TiDB Operator
- Résumé des diagrammes de description des broches de la série ESP
- 使用 BR 备份 TiDB 集群数据到兼容 S3 的存储
- CAD ARX gets the current viewport settings
- Circular reference of ES6 module
- Image fusion -- challenges, opportunities and Countermeasures
- 2022.02.13 - NC003. Design LRU cache structure
- 从 TiDB 集群迁移数据至另一 TiDB 集群
- ESP系列引脚說明圖匯總
猜你喜欢

IP lab, the first weekly recheck

Hungry for 4 years + Ali for 2 years: some conclusions and Thoughts on the road of research and development

3. File operation 3-with

C language - bit segment

Summary of phased use of sonic one-stop open source distributed cluster cloud real machine test platform

Circular reference of ES6 module

Synchronized solves problems caused by sharing

【MySQL】锁

Pyqt5 development tips - obtain Manhattan distance between coordinates

【MySQL】数据库的存储过程与存储函数通关教程(完整版)
随机推荐
Vocabulary notes for postgraduate entrance examination (3)
ESP series pin description diagram summary
Hcip day 16
Erc20 token agreement
Migrate data from SQL files to tidb
C language custom type: struct
使用 TiUP 升级 TiDB
Résumé des diagrammes de description des broches de la série ESP
[MySQL] database stored procedure and storage function clearance tutorial (full version)
Wireshark grabs packets to understand its word TCP segment
Summary of MySQL index failure scenarios
Make learning pointer easier (3)
【刷题】牛客网面试必刷TOP101
[Yugong series] February 2022 U3D full stack class 010 prefabricated parts
Zhong Xuegao, who cannot be melted, cannot escape the life cycle of online celebrity products
[2022 Guangdong saim] Lagrange interpolation (multivariate function extreme value divide and conquer NTT)
MFC 给列表控件发送左键单击、双击、以及右键单击消息
Yyds dry goods inventory three JS source code interpretation eventdispatcher
指针和数组笔试题解析
Summary of phased use of sonic one-stop open source distributed cluster cloud real machine test platform