Steven Smith revised this gist . Go to revision
2 files changed, 26 insertions
firetest.py(file created)
| @@ -0,0 +1,13 @@ | |||
| 1 | + | #!/usr/bin/env python3.6 | |
| 2 | + | import fire # pypi.python.org/pypi/fire | |
| 3 | + | ||
| 4 | + | class Example: | |
| 5 | + | def hello(self, name="world"): | |
| 6 | + | """Testing""" | |
| 7 | + | return f"Hello {name}!" | |
| 8 | + | ||
| 9 | + | def main(): | |
| 10 | + | fire.Fire(Example) | |
| 11 | + | ||
| 12 | + | if __name__ == "__main__": | |
| 13 | + | main() | |
zOut.txt(file created)
| @@ -0,0 +1,13 @@ | |||
| 1 | + | $ python3 firetest.py | |
| 2 | + | Type: Example | |
| 3 | + | String form: <__main__.Example object at 0x1028cf470> | |
| 4 | + | File: ~/firetest.py | |
| 5 | + | ||
| 6 | + | Usage: firetest.py | |
| 7 | + | firetest.py hello | |
| 8 | + | ||
| 9 | + | $ python3 firetest.py hello | |
| 10 | + | Hello world! | |
| 11 | + | ||
| 12 | + | $ python3 firetest.py hello there | |
| 13 | + | Hello there! | |
Newer
Older