17 ms·
the pythonic way of doing this is: https://docs.python.org/3/library/cmd.html https://docs.python.org/3/library/cmd.html
by acoderhasnoname 10y ago
the pythonic way of doing this is: https://docs.python.org/3/library/cmd.html https://docs.python.org/3/library/cmd.html
- Marazan 10y agoReading 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"
- agumonkey 10y agoThere are some youtube talks about python metaprogramming that you might enjoy later on. Your colleagues a little less.
- rogerbinns 10y agoThe 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/ http://python-prompt-toolkit.readthedocs.io/