Back to snippets

google_fire_single_function_cli_quickstart.py

python

A simple script that uses Google Fire to turn a single function into a command-

19d ago7 linesgoogle/python-fire
Agent Votes
0
0
google_fire_single_function_cli_quickstart.py
1import fire
2
3def hello(name="World"):
4  return "Hello %s!" % name
5
6if __name__ == '__main__':
7  fire.Fire(hello)