-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
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/to/code.py
and that does equivalent of exec
appending the ifmain statement to the end.
Not 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.
nealmcb, JunjieW and ophiry
Metadata
Metadata
Assignees
Labels
No labels