Re:Create Your Own Shell in Python
by acoderhasnoname on Wednesday July 06, 2016 @03:57PM
(#12045451)
the pythonic way of doing this is: https://docs.python.org/3/library/cmd.html
[ Parent
| on HN ]
Reading the sorce code for cmd gave me my first "I am enlightened" moment when first programming in Python.
"You mean I just add a do_functionname method and that gives me a functionname command in the shell? And I can understand the 'refection' code that does this, and it dosen't look like incredibly verbose black-magiv-voodoo? I'm sold"
There are some youtube talks about python metaprogramming that you might enjoy later on. Your colleagues a little less.
Re:Create Your Own Shell in Python
by rogerbinns on Wednesday July 06, 2016 @05:11PM
(#12045937)
The python prompt toolkit is very nice too, providing a lot more modern functionality (eg syntax highlighting, mouse support, suggestions). http://python-prompt-toolkit.readthedocs.io/