By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,818 Members | 1,347 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,818 IT Pros & Developers. It's quick & easy.

cmd Library Module trouble

P: n/a
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()
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Juan Stang wrote:
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
Jul 18 '05 #2

P: n/a
Thank you Fernando!

Solved the problem entirely. Appreciate it.
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.