python 第三方库

时间:2023-02-17 12:22:08

1.tqdm 进度条

from tqdm import tqdm

for i in tqdm(range(10000)):
pass

2.fire 自动创建命令行接口(command line interfaces)

a.单个函数

import fire
def hello():
print("hello world!") if __name__ == '__main__':
fire.Fire()

b.多个函数  python hello.py hello1 "beijing"

#hello.py

import fire
def hello1(place):
print("hello world1! I'm in"+place)
def hello2(name):
print("hello world2!"+name)
if __name__ == '__main__':
fire.Fire()