Python-argparse-命令行与参数解析
import argparse
parser=argparse.ArgumentParser(description='')
parser.add_argument('--name', type=str, default='experiment_name', help='name of the experiment. It decides where to store samples)
tqdm进度条的使用
from tqdm import tqdm
import time
for i in tqdm(range(100)):
time.sleep(0.1)
pass
fire生成命令行接口的使用
import fire
def add(a,b):
count=a+b
return count
if __name__=='__main__':
fire.Fire()
运行如下命令:
python try.py add 1 3