Skip to content

Instantly share code, notes, and snippets.

@blha303
Created April 9, 2017 07:42
Show Gist options
  • Save blha303/a2e4004c3f31ae3831ecae01cf0bb73b to your computer and use it in GitHub Desktop.
Save blha303/a2e4004c3f31ae3831ecae01cf0bb73b to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3.6
import fire # pypi.python.org/pypi/fire
class Example:
def hello(self, name="world"):
"""Testing"""
return f"Hello {name}!"
def main():
fire.Fire(Example)
if __name__ == "__main__":
main()
$ python3 firetest.py
Type: Example
String form: <__main__.Example object at 0x1028cf470>
File: ~/firetest.py
Usage: firetest.py
firetest.py hello
$ python3 firetest.py hello
Hello world!
$ python3 firetest.py hello there
Hello there!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment