Python編程:fire庫(kù)自動(dòng)生成命令行接口
發(fā)布時(shí)間:2021-11-23 點(diǎn)擊數(shù):592
命令行接口(Command Line Interface,簡(jiǎn)稱(chēng)CLI)
# -*- coding: utf-8 -*- # @File : fire_CLI_demo.py # @Date : 2018-06-03 import fire class Person(object): def hello(self, name="world"): print("hell %s"% name) if __name__ == '__main__': fire.Fire(Person) # 運(yùn)行命令: python fire_CLI_demo.py hello