Cmdクラスでは、行指向のコマンドインタープリタを書くための簡単なフレームワークを提供します。テスト用の仕掛けや管理ツール、そして、後により洗練されたインターフェイスでラップするプロトタイプとして、こうしたインタープリタはよく役に立ちます。
[completekey],[stdin],[stdout]) |
オプション引数 completekey は、補完キーのreadline名です。デフォルトはTabです。completekeyがNone
でなく、readlineが利用できるならば、コマンド補完は自動的に行われます。
! The optional arguments stdin and stdout specify the ! input and output file objects that the Cmd instance or subclass ! instance will use for input and output. If not specified, they ! will default to sys.stdin and sys.stdout. ! オプション引数 stdinとstdoutには、Cmd インスタンス又はサブクラスのインスタンスが入出力に使用するファイルオブジェクトを指定します。省略時にはsys.stdin と sys.stdout を使用します。
バージョン2.3 以降で変更された 仕様: 引数 stdin と stdout を追加