Created
April 9, 2017 07:42
-
-
Save blha303/a2e4004c3f31ae3831ecae01cf0bb73b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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