cmd Library Module trouble

J

Juan Stang

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()
 
F

Fernando Perez

Juan said:
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!

There's no native Windows readline with python. This means you have a
third-party readline module somewhere. There's a readline out there
(Chris ....? wrote it, can't remember the name) which is _very_ problematic: it
does NOT expose the full readline API, so modules which try to import it
succeed initially, only to later crash horribly because the thing is very
incomplete.

If you want readline support under windows, google('uncpythontools'), you'll
find Gary Bishop's _excellent_ library, which adds proper ANSI color hanlding
to the pathetic Windows terminal.

Best,

f
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,812
Messages
2,569,694
Members
45,478
Latest member
dontilydondon

Latest Threads

Top