cmd 模块
from cmd import Cmd
下面为Cmd的初始化
class Cmd:
"""A simple framework for writing line-oriented command interpreters.
These are often useful for test harnesses, administrative tools, and
prototypes that will later be wrapped in a more sophisticated interface.
A Cmd instance or subclass instance is a line-oriented interpreter
framework. There is no good reason to instantiate Cmd itself; rather,
it's useful as a superclass of an interpreter class you define yourself
in order to inherit Cmd's methods and encapsulate action methods.
"""
prompt = PROMPT # 默认为:(Cmd) 可修改,如改为 prompt="robot>"
identchars = IDENTCHARS
ruler = '='
lastcmd = ''
intro = None # 开始介绍信息
doc_leader = ""
doc_header = "Documented commands (type help <topic>):"
misc_header =