当前位置:网站首页>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
边栏推荐
- CISP-PTE实操练习讲解
- From monomer structure to microservice architecture, introduction to microservices
- 图像融合--挑战、机遇与对策
- Make learning pointer easier (3)
- Artcube information of "designer universe": Guangzhou implements the community designer system to achieve "great improvement" of urban quality | national economic and Information Center
- CAD ARX gets the current viewport settings
- leetcode刷题 (5.28) 哈希表
- Go learning notes (3) basic types and statements (2)
- Yyds dry goods inventory three JS source code interpretation eventdispatcher
- 从 SQL 文件迁移数据到 TiDB
猜你喜欢
Fibonacci sequence
Asia Pacific Financial Media | designer universe | Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers
[t31zl intelligent video application processor data]
[untitled]
【MySQL】数据库的存储过程与存储函数通关教程(完整版)
[cloud native topic -45]:kubesphere cloud Governance - Introduction and overall architecture of enterprise container platform based on kubernetes
A Closer Look at How Fine-tuning Changes BERT
Pyqt5 development tips - obtain Manhattan distance between coordinates
Online yaml to CSV tool
好用的TCP-UDP_debug工具下载和使用
随机推荐
灰度升级 TiDB Operator
IP lab, the first weekly recheck
leetcode刷题 (5.28) 哈希表
Use dumping to back up tidb cluster data to S3 compatible storage
ESP series pin description diagram summary
C language - bit segment
Make learning pointer easier (3)
LDAP application (4) Jenkins access
2022.02.13 - NC004. Print number of loops
Circular reference of ES6 module
C语言 - 位段
远程存储访问授权
A Closer Look at How Fine-tuning Changes BERT
Hcip day 16
matplotlib. Widgets are easy to use
ESP系列引脚說明圖匯總
C language custom type: struct
Go learning notes (3) basic types and statements (2)
Leetcode question brushing record | 203_ Remove linked list elements
logback1.3. X configuration details and Practice