The biggest gripe I have with using Python for rich command-line tool is the startup time. One of the first reason I like to write a nice command-line tool when I start a project, say foo, is to be able to do `foo --help` to quickly see and remember what the project can do (I have a very bad memory and doing this makes it possible for me to jump back faster to a project, even well documented. I can forget what I was…
I'm completely clueless about this, but would it be possible to have a persistent python interpreter always running in the background somehow, and submit the commands to it?
edit: my test was flawed, with more accurate test there is almost a full second time difference:
$ echo -n | time ipython console --existing kernel-29793.json
1.06user 0.06system 0:01.52elapsed 74%CPU (0avgtext+0avgdata 29968maxresident)k
0inputs+64outputs (0major+19245minor)pagefaults 0swaps
$ echo -n | time ipython console
1.07user 0.08system 0:02.40elapsed 48%CPU (0avgtext+0avgdata 30264maxresident)k
0inputs+72outputs (0major+20538minor)pagefaults 0swaps
of course two seconds is ridiculously slow either way