[code.view]

[top] / python / PyMOTW / cmd / cmd_attributes.py

     #!/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."""
     
         prompt = 'prompt: '
         intro = "Simple command processor example."
     
         doc_header = 'doc_header'
         misc_header = 'misc_header'
         undoc_header = 'undoc_header'
         
         ruler = '-'
         
         def do_prompt(self, line):
             "Change the interactive prompt"
             self.prompt = line + ': '
     
         def do_EOF(self, line):
             return True
     
     if __name__ == '__main__':
         HelloWorld().cmdloop()

[top] / python / PyMOTW / cmd / cmd_attributes.py

contact | logmethods.com