473,407 Members | 2,359 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,407 software developers and data experts.

how to move cursor in Interactive Interpreter

i have a question.
when i run Interactive Interpreter in linux command promt,how can i
move the cursor.
for example,when i enter a string,i often enter the quotation mark ""
first,and the move the cursor inside the mark to enter the string,in
windows,it is ok.but when i do that in linux,pressing the "left" key
will just print "^[[D" in the screen ,but not what i want.
so , how can i move the cursor Interactive Interpreter in linux?
i've googled and find nothing useful.who i tell me what to do?

Aug 14 '07 #1
4 3273
ya********@gmail.com wrote:
i have a question.
when i run Interactive Interpreter in linux command promt,how can i
move the cursor.
for example,when i enter a string,i often enter the quotation mark ""
first,and the move the cursor inside the mark to enter the string,in
windows,it is ok.but when i do that in linux,pressing the "left" key
will just print "^[[D" in the screen ,but not what i want.
so , how can i move the cursor Interactive Interpreter in linux?
i've googled and find nothing useful.who i tell me what to do?
Python uses GNU readline for cursor movements. The Python version that ships
with your distribution should work out of the box. If you compile Python
yourself make sure that the development package (not just the binary) is
installed. For Suse this is readline-devel.

Peter
Aug 14 '07 #2
On 8 14 , 2 44 , Peter Otten <__pete...@web.dewrote:
yan.pyt...@gmail.com wrote:
i have a question.
when i run Interactive Interpreter in linux command promt,how can i
move the cursor.
for example,when i enter a string,i often enter the quotation mark ""
first,and the move the cursor inside the mark to enter the string,in
windows,it is ok.but when i do that in linux,pressing the "left" key
will just print "^[[D" in the screen ,but not what i want.
so , how can i move the cursor Interactive Interpreter in linux?
i've googled and find nothing useful.who i tell me what to do?

Python uses GNU readline for cursor movements. The Python version that ships
with your distribution should work out of the box. If you compile Python
yourself make sure that the development package (not just the binary) is
installed. For Suse this is readline-devel.

Peter
thanks for your reply
I thought maybe i just didn't install readline correctly,so i deleted
python and tried to re-compile the source code(I downloaded the .bz2
version).This time ,I found in the "./Modules/Setup" the description
for "readline":

# GNU readline. Unlike previous Python incarnations, GNU readline is
# now incorporated in an optional module, configured in the Setup
file
# instead of by a configure script switch. You may have to insert a
# -L option pointing to the directory where libreadline.* lives,
# and you may have to change -ltermcap to -ltermlib or perhaps remove
# it, depending on your system -- see the GNU readline instructions.
# It's okay for this to be a shared library, too.

#readline readline.c -lreadline -ltermcap

dont know exactly what to do,I just delete the "#" mark in the line
"#readline readline.c -lreadline -ltermcap " , then tried to
"configure","make",but errors of readline occor here.
what am i supposed to do to install the module GNU readline correctly
then?
thanks

by the way,my linux is Mandriva 10

Aug 14 '07 #3
ya********@gmail.com wrote:
what am i supposed to do to install the module GNU readline correctly
then?
by the way,my linux is Mandriva 10
Use the package manager of your distribution to install the readline
development package -- after some struggle with Mandriva's website I came
to suppose that it's libreadline5-devel for you:

urpmi libreadline5-devel.rpm

After you have successfully installed that package unpack the python archive
into a fresh directory and do the configure/make/install dance. No manual
changes should be necessary.

Peter

Aug 14 '07 #4
On 8 14 , 9 20 , Peter Otten <__pete...@web.dewrote:
yan.pyt...@gmail.com wrote:
what am i supposed to do to install the module GNU readline correctly
then?
by the way,my linux is Mandriva 10

Use the package manager of your distribution to install the readline
development package -- after some struggle with Mandriva's website I came
to suppose that it's libreadline5-devel for you:

urpmi libreadline5-devel.rpm

After you have successfully installed that package unpack the python archive
into a fresh directory and do the configure/make/install dance. No manual
changes should be necessary.

Peter


i've re-install python as you said,and it works now
i really appreciate your help
thanks!

Aug 14 '07 #5

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

Similar topics

147
by: Sateesh | last post by:
Hi, I am a beginner in Python, and am wondering what is it about the indentation in Python, without which python scripts do not work properly. Why can't the indentation not so strict so as to give...
6
by: Avi Berkovich | last post by:
Hello, I was unable to use popen2.popen4 to grab python.exe's (2.3) output, for starts, it doesn't show the version information at the beginning and won't return anything when writing to the...
2
by: Miki Tebeka | last post by:
Hello All, If there a way a script can tell Python to enter interactive mode even if the -i command line switch was not given? I want py2exe to create an interactive session, without writing...
2
by: siggy2 | last post by:
Hi All, (sorry for my bad english) I wrote a __tiny__ and __stupid__ recursive script directly into pythonwin interactive window with a time.sleep(1) and a print before each recursion... I...
13
by: dmh2000 | last post by:
I am experimenting with the interactive interpreter environments of Python and Ruby and I ran into what seems to be a fundamental difference. However I may be doing something wrong in Python....
10
by: notejam | last post by:
I am trying to get started with a interactive version of Python for windows and need some help. I have played with the tutorial, and now want to write a program. In basic language, I could write...
0
by: Simon Eves | last post by:
I am trying to write a Python module to embed the functionality of Maya (the 3D modelling and animation application from Autodesk, formerly Alias) for doing scripted scene manipulation and...
3
by: Sal | last post by:
I'm running PHP 5.2.6 on WindowsXP. When I try interactive mode with ">php -a" the slightest syntax error throws me out of the interpreter and back to the command line. This is not very useful....
3
by: R. Bernstein | last post by:
The next release of pydb will have the ability to go into ipython from inside the debugger. Sort of like how in ruby-debug you can go into irb :-) For ipython, this can be done pretty simply;...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.