执行Cmd.cmdloop()时不会出现提示

时间:2014-03-15 20:57:14

标签: python python-3.x

我有这个极简主义的例子来尝试cmd2

from cmd2 import Cmd                 

class App(Cmd):                      
    def __init__(self, name='world'):
        Cmd.__init__(self)           
        self.name = name             

    def do_printhello(self):         
        print('hello ' + self.name)      

a = App()                            
a.cmdloop()                          

我希望在运行时出现提示,但没有任何反应:

$ ./test.py
$

0 个答案:

没有答案
相关问题