0
我已經用python cmd2模塊實現了一個自定義命令行。Python cmd2模塊發送命令
from cmd2 import Cmd
class CliApp(Cmd):
.....
現在我還需要發送命令到我的自定義命令行從其他python項目。 我想:
send = CliApp().send
print send('hello')
這給錯誤:
AttributeError: Cmd instance has no attribute 'send'
我自己也嘗試從原來的例子:
cmd2 - the-send-method - 但它給出了同樣的錯誤。