python 第三方库 工具

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()

  

  

  

  

posted @ 2019-03-07 15:53  youqia  阅读(259)  评论(0编辑  收藏  举报