Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # encoding: utf-8
- #
- # Copyright (c) 2008 Doug Hellmann All rights reserved.
- #
- """
- """
- __version__ = "$Id$"
- #end_pymotw_header
- import cmd
- class HelloWorld(cmd.Cmd):
- """Simple command processor example."""
- # Disable rawinput module use
- use_rawinput = False
- # Do not show a prompt after each command read
- prompt = ''
- def do_greet(self, line):
- print "hello,", line
- def do_EOF(self, line):
- return True
- if __name__ == '__main__':
- import sys
- with open(sys.argv[1], 'rt') as input:
- HelloWorld(stdin=input).cmdloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement