指令行接口(Command Line Interface,簡稱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)
# 運作指令: python fire_CLI_demo.py hello
參考