Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from cmd import Cmd
- from Queue import Queue
- import os
- class MyShell(Cmd):
- def do_cd(self, *args):
- os.chdir(args[0])
- def do_pwd(self, args):
- """Prints the working directory"""
- print os.getcwd()
- def do_quit(self, args):
- """Quits the program."""
- print "Quitting."
- raise SystemExit
- if __name__ == '__main__':
- prompt = MyShell()
- prompt.prompt = '> '
- prompt.cmdloop('Starting prompt...')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement