From b7178d2899423a2f060de8feb920a8f4bfbd1de3 Mon Sep 17 00:00:00 2001 From: shwetha729 Date: Thu, 28 Sep 2023 01:14:38 -0400 Subject: [PATCH] Updated: Thursday, September 28,2023-09-28 01:14:37 --- .../plugins/recent-files-obsidian/data.json | 8 +++--- enter/.obsidian/workspace.json | 26 ++++++++++++++----- enter/Fire.md | 24 +++++++++++++++++ 3 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 enter/Fire.md diff --git a/enter/.obsidian/plugins/recent-files-obsidian/data.json b/enter/.obsidian/plugins/recent-files-obsidian/data.json index 70e1806..ac5c18d 100644 --- a/enter/.obsidian/plugins/recent-files-obsidian/data.json +++ b/enter/.obsidian/plugins/recent-files-obsidian/data.json @@ -1,5 +1,9 @@ { "recentFiles": [ + { + "basename": "Fire", + "path": "Fire.md" + }, { "basename": "1.About Languages", "path": "Coding Tips (Classical)/Terminal Tips/Languages/1.About Languages.md" @@ -195,10 +199,6 @@ { "basename": "Trunked Radio", "path": "Coding Tips (Classical)/Project Vault/Communication Projects/RADIO/Software/Trunked Radio.md" - }, - { - "basename": "Radio @ K2HMH", - "path": "Coding Tips (Classical)/Project Vault/Communication Projects/RADIO/HM Wiki/Radio @ K2HMH.md" } ], "omittedPaths": [], diff --git a/enter/.obsidian/workspace.json b/enter/.obsidian/workspace.json index daf25c1..2d43c43 100644 --- a/enter/.obsidian/workspace.json +++ b/enter/.obsidian/workspace.json @@ -26,9 +26,21 @@ "source": false } } + }, + { + "id": "82726a166dd2a829", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "Fire.md", + "mode": "source", + "source": false + } + } } ], - "currentTab": 1 + "currentTab": 2 } ], "direction": "vertical" @@ -102,7 +114,7 @@ "state": { "type": "outgoing-link", "state": { - "file": "Coding Tips (Classical)/Terminal Tips/Languages/1.About Languages.md", + "file": "Fire.md", "linksCollapsed": false, "unlinkedCollapsed": true } @@ -135,7 +147,7 @@ "state": { "type": "outline", "state": { - "file": "Coding Tips (Classical)/Terminal Tips/Languages/1.About Languages.md" + "file": "Fire.md" } } }, @@ -145,7 +157,7 @@ "state": { "type": "backlink", "state": { - "file": "Coding Tips (Classical)/Terminal Tips/Languages/1.About Languages.md", + "file": "Fire.md", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -177,8 +189,10 @@ "command-palette:Open command palette": false } }, - "active": "c9cd512fcf3f7b9e", + "active": "82726a166dd2a829", "lastOpenFiles": [ + "Coding Tips (Classical)/Terminal Tips/Languages/1.About Languages.md", + "Fire.md", "Coding Tips (Classical)/Terminal Tips/CLI Tools/CLI Tool Collection/Commands + Settings/Command Shortcuts.md", "Coding Tips (Classical)/Terminal Tips/CLI Tools/CLI Tool Collection/Commands + Settings/ASCII.md", "Coding Tips (Classical)/Terminal Tips/CLI Tools/CLI Tool Collection/Commands + Settings/Aliases.md", @@ -204,8 +218,6 @@ "Coding Tips (Classical)/Project Vault/Communication Projects/RADIO/Hardware/Optical Network Terminals.md", "Coding Tips (Classical)/Terminal Tips/Languages/Go/Welcome to Go.md", "Coding Tips (Classical)/Terminal Tips/CLI Tools/CLI Tool Collection/Mods.md", - "Coding Tips (Classical)/Terminal Tips/Languages/Documentation.md", - "Coding Tips (Classical)/Project Vault/Website Projects/Obsidian/Obsidian Guides/Notable Obsidians.md", "Coding Tips (Classical)/Terminal Tips/Servers/Virtual Machines/VirtualBox", "Coding Tips (Classical)/Terminal Tips/Servers/Virtual Machines/Quay", "Coding Tips (Classical)/Project Vault/Website Projects/Obsidian/imgFiles/Pasted image 20230924025824.png", diff --git a/enter/Fire.md b/enter/Fire.md new file mode 100644 index 0000000..07f0676 --- /dev/null +++ b/enter/Fire.md @@ -0,0 +1,24 @@ + +Python [fire](https://github.com/google/python-fire) is extremely useful for automatically generating command line interfaces (CLIs) from absolutely any Python object. + +Examples: + +The python class: +```python +import fire + +class Calculator(object): + """A simple calculator class.""" + + def double(self, number): + return 2 * number + +if __name__ == '__main__': + fire.Fire(Calculator) +``` + +Then, when calling the file on the terminal, the CLI is already there: +```shell +python calculator.py double 10 # 20 +python calculator.py double --number=15 # 30 +``` \ No newline at end of file