Tab key is not indented in Python

I recently upgraded to python2.7 and noticed that the tab key is not working properly in the shell. Instead, it searches for a search in the base directory (standard unix behavior).

If I go back to python2.6, it will work accordingly. Is there any way to add this functionality back to 2.7?

For instance:

if foo:
  (tab here) print 'bar' #desired behavior is that the tab adds padding here

Solution:
This is a known issue with python2.7 on Mac OSX. I used the following workaround to fix it:

$ cat > $HOME/.pystartup
import readline
if 'libedit' in readline.__doc__:
   readline.parse_and_bind("bind ^I ed-insert")
^D
$ export PYTHONSTARTUP=$HOME/.pystartup
+3
source share
1 answer

python 2.7 Mac OSX. ( ) .

+9

Source: https://habr.com/ru/post/1788031/


All Articles