I wrote this demo command line interpreter to demonstrate using the
cmd module: https://gist.github.com/amitsaha/6047955

<code>

$ python3 demo_cmd_interpreter.py
Welcome to Dummy shell. Type help or ? to list commands.


dummyshell>> help

Documented commands (type help <topic>):
========================================
exit  help  shell  whoami


dummyshell>> whoami
gene

dummyshell>> !date
Sun Sep 22 13:00:01 EST 2013



dummyshell>> quit
Bye!

</code>

To learn more about the cmd module: http://docs.python.org/3/library/cmd.html

Hope someone finds this useful in their learning/teaching.


Best,
Amit.
-- 
http://echorand.me
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to