This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
def get_args(): | |
parser = argparse.ArgumentParser(description='整个参数列表的自定义名称') | |
parser.add_argument('--{argument参数提示符}',type={int/str...数据输入类型},default={默认数据},help='{命令提示内容}':q) | |
return parser.parse_args() | |
args = get_args() | |
args.{argument参数提示符} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import configparser | |
config = configparser.ConfigParser() | |
config.read({file}.ini) | |
config['FILE_DATA']['path'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import platform as plat | |
system_type = plat.system() # 由于不同的系统的文件路径表示不一样,需要进行判断 |
NewerOlder