cmd Library Module trouble

Juan Stang greg at thirdstone.net
Fri May 14 03:33:31 EDT 2004


Hope someone can help ...

My Python sys.version prints out as follows:
'2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)]'

I'm also running Windows XP SP1 and I have installed PyGame 1.6,
wxWindows 2.5 and the latest Twisted dist. I only include these for
the sake of completeness.

I'm trying to write something using the 'cmd' module, but I get the
error below when I run the source included at the end of this post.
It's pretty basic. This looks like a readline error, but the Python
documentation states that the cmd module should be OS independent, and
I'm not trying to use any readline features. Any ideas??? Please help!

Juan

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "c:/DOCUME~1/CHROMO~1/LOCALS~1/Temp/python-3672MGt", line 15,
in ?
    tn.cmdloop()
  File "C:\Python23\lib\cmd.py", line 109, in cmdloop
    self.preloop()
  File "C:\Python23\lib\cmd.py", line 153, in preloop
    self.old_completer = readline.get_completer()
AttributeError: 'module' object has no attribute 'get_completer

## Source

import os
import cmd

class TimeNote(cmd.Cmd):

	def __init__(self):
		cmd.Cmd.__init__(self)
		self.prompt = ">> "
		self.intro = "Welcome to TimeNote"


if __name__ == "__main__":
	tn = TimeNote()
	tn.cmdloop()



More information about the Python-list mailing list