After testing the time with the Cmd.cmd framework in python, I noticed a problem that I don't know what to do about. Plus, I find this work a few hours before (or I'm just crazy), so it's even weirder.
I have the following sample code tested on both Windows and Linux systems (so this is not a Windows problem), but the tab just doesn't work.
If I use the same code in Python 2, it works on a Linux system (but not on Windows, though)
import cmd
class Shell ( cmd.Cmd ):
def do_test ( self, params ):
print( 'test: ' + params )
def do_exit ( self, params ):
return True
def do_quit ( self, params ):
return True
if __name__ == '__main__':
x = Shell()
x.cmdloop()
Do you know why this is happening, or what can I do to make tab completion possible?
source
share