473,322 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Confusion regarding the readline module

Hi!
I am having some doubts related to the readline module. I hope someone
could clear them.
1. What exactly does the readline.get_line_buffer() function do? Does
it return whatever is the current input by the user? If yes, then can
I use it to check the current inputs of the user and base the next-
word completion against whatever the user has entered so far? There
wasn't much documentation on it, and a lot of googling couldn't help
much. :(
2. Related to the completer function, what is meant by returning the
"state"th completion for "text"? Is the completer function called
everytime (for all possible values of "state") when I press the Tab
key? When/How is it called?

Basically, I need to define a completer function, that should take
into consideration whatever the user has entered so far, and complete
the next word accordingly. The same way as a "cd /some/file" is
meaningless.
Jun 27 '08 #1
1 854
Siddhant wrote:
Hi!
I am having some doubts related to the readline module. I hope someone
could clear them.
1. What exactly does the readline.get_line_buffer() function do? Does
it return whatever is the current input by the user? If yes, then can
I use it to check the current inputs of the user and base the next-
word completion against whatever the user has entered so far? There
wasn't much documentation on it, and a lot of googling couldn't help
much. :(
2. Related to the completer function, what is meant by returning the
"state"th completion for "text"? Is the completer function called
everytime (for all possible values of "state") when I press the Tab
key? When/How is it called?

Basically, I need to define a completer function, that should take
into consideration whatever the user has entered so far, and complete
the next word accordingly. The same way as a "cd /some/file" is
meaningless.
I don't know anything about readline (beyond it's existence of course) - but
I do know & use the rlcompleter2 module. Go download it and look into it's
source, it should give you an idea how to proceed.

Diez
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: michele.simionato | last post by:
This a case where the documentation is lacking. The standard library documentation (http://www.python.org/dev/doc/devel/lib/module-rlcompleter.html) gives this example try: import readline...
0
by: Brano Zarnovican | last post by:
Hi ! I'd like to init curses and still have working Python interactive command line. I found that you can replace stdin/stdout/stderr like this: #!/usr/bin/python -i import curses import...
1
by: Kevin | last post by:
In a newsgroup thread from Jan 8, 2003 between Barry Holsinger and the VBDotNet Team, please review this excerpt: "You understood my problem completely. Your sample code provides a really...
4
by: David Bear | last post by:
I built python 2.4.2 for suse linux 9.3. I configured it to be a separate instance of python from the version packaged with suse. Now when I start it I get an error: python Python 2.4.2 (#4,...
3
by: geevaa | last post by:
Hi group, PHP Warning: Module 'readline' already loaded in Unknown on line 0 what this warning means? please help me by explaining
3
by: Josh Paetzel | last post by:
Is there a way to ensure that GNU readline isn't used (even though support may have been compiled in?). I'm experiencing a licensing problem, I'd like to use the "cmd" module, for example, but my...
2
by: Grant Edwards | last post by:
I'm trying to figure out how to use the gnu readline library so that when my program is prompting the user for input there is line editing and history support. I've read and re-read the...
0
by: Akira Kitada | last post by:
Hi Marc-Andre, Thanks for the suggestion. I opened a ticket for this issue: http://bugs.python.org/issue4204 Now I understand the state of the multiprocessing module, but it's too bad to see...
0
by: M.-A. Lemburg | last post by:
On 2008-10-25 20:19, Akira Kitada wrote: Thanks. The errors you are getting appear to be related to either some missing header files or a missing symbol definition to enable these - looking...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.