We have a module that is really useful to run interactively as a commandline script.
python -i tool
All users are python coders. So while there has been talk of making an interactive commandline app, the power of just being able to use the tool with code nobody wants to abandon, and it would be too much to recode that kind of power, unless there is something obvious.
Literally the only annoyance is having to type
python -i tool
Because everyone types
./tool
gets an unhelpful message and remembers.
I was going to improve the message. But I wondered if I could just make it work. When the script is run can it run itself with -i
. If the script is a different name from the module, it can be a shell script. But the same file? Can I run python interactively just from the
if __name__ == "__main__":
bit?