Title: Use fire without editing code directly · Issue #29 · google/python-fire · GitHub
Open Graph Title: Use fire without editing code directly · Issue #29 · google/python-fire
X Title: Use fire without editing code directly · Issue #29 · google/python-fire
Description: Currently you have to add something like this to the end of your file just to mess around with fire: if __name__ == '__main__': fire.Fire() and then run with python path/to/code.py But it'd be neat if instead you could just do fire path/...
Open Graph Description: Currently you have to add something like this to the end of your file just to mess around with fire: if __name__ == '__main__': fire.Fire() and then run with python path/to/code.py But it'd be neat...
X Description: Currently you have to add something like this to the end of your file just to mess around with fire: if __name__ == '__main__': fire.Fire() and then run with python path/to/code.py But it...
Opengraph URL: https://github.com/google/python-fire/issues/29
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Use fire without editing code directly","articleBody":"Currently you have to add something like this to the end of your file just to mess around with fire:\r\n\r\n```\r\nif __name__ == '__main__':\r\n fire.Fire()\r\n```\r\nand then run with\r\n\r\n```\r\npython path/to/code.py\r\n```\r\n\r\nBut it'd be neat if instead you could just do\r\n\r\n```\r\nfire path/to/code.py\r\n```\r\n\r\nand that does equivalent of `exec` appending the ifmain statement to the end.\r\n\r\nNot sure *how* to do it - I know kernprof does some magic to inject into builtins before exec'ing code. (or maybe you get a code object back from exit) - but this would make fire even better as a debugging tool as well.","author":{"url":"https://github.com/jtratner","@type":"Person","name":"jtratner"},"datePublished":"2017-03-22T19:29:09Z","url":"https://github.com/google/python-fire/issues/29"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6230fa91-822a-5a02-51da-8fa74c7b4379 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A238:392E27:4F7700:66B42F:6AFFD05B |
| html-safe-nonce | 9e5992701153b2ef6e6106d141b905eb8a220491b2ed5af76a6f6e9bb0e63222 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjM4OjM5MkUyNzo0Rjc3MDA6NjZCNDJGOjZBRkZEMDVCIiwidmlzaXRvcl9pZCI6IjQyNzQzMzI4ODMzMzU3NjIwMTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b28b78af3b2c3fc9f23e9bf884d5aad39aaafaba006480c77dd63ff7fd1aa4df |
| hovercard-subject-tag | issue:216182118 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/google/python-fire/29/issue_layout |
| twitter:image | https://opengraph.githubassets.com/803f163658e86cb5caa35cc0f18732063bc5a2177e9ac65432f38d1e8052c25f/google/python-fire/issues/29 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/803f163658e86cb5caa35cc0f18732063bc5a2177e9ac65432f38d1e8052c25f/google/python-fire/issues/29 |
| og:image:alt | Currently you have to add something like this to the end of your file just to mess around with fire: if __name__ == '__main__': fire.Fire() and then run with python path/to/code.py But it'd be neat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jtratner |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| turbo-cache-control | no-preview |
| go-import | github.com/google/python-fire git https://github.com/google/python-fire.git |
| octolytics-dimension-user_id | 1342004 |
| octolytics-dimension-user_login | |
| octolytics-dimension-repository_id | 82729529 |
| octolytics-dimension-repository_nwo | google/python-fire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 82729529 |
| octolytics-dimension-repository_network_root_nwo | google/python-fire |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width