Skip to content

Instantly share code, notes, and snippets.

@bprashanth
Created April 21, 2016 00:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bprashanth/9a3c8dfbba443698ddd960b8087107bf to your computer and use it in GitHub Desktop.
Save bprashanth/9a3c8dfbba443698ddd960b8087107bf to your computer and use it in GitHub Desktop.
from cmd import Cmd
class MyPrompt(Cmd):
def do_hello(self, args):
"""Says hello."""
print "Hello, world"
def do_quit(self, args):
"""Quits the program."""
print "Quitting."
raise SystemExit
if __name__ == '__main__':
prompt = MyPrompt()
prompt.prompt = '> '
prompt.cmdloop('Starting prompt...')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment