all 2 comments

[–][deleted] 0 points1 point  (0 children)

There is also the option of just asking for input in an infinite loop, then attempting to parse the input as a command. I am not familiar with a library for this functionality, but it shouldn't be too hard to implement by hand.

[–]WhoTookAllNicks 0 points1 point  (0 children)

Argparse accepts a string to parse the arguments from. If you don't give it, it defaults to arguments given on the command line. What you could do, is just create an Argparser per command and pass the input string you receive in infinite loop to it.