Python在Linux下的Tab补齐

 

         Tab补齐的功能就不在累赘了,用过Linux的同学都明白。

 

vi /root/.pythonstartup

import sys

import readline

import rlcompleter

import atexit

import os

readline.parse_and_bind('tab: complete')

histfile =   os.path.join(os.environ['HOME'], '.pythonhistory')

try:

      readline.read_history_file(histfile)

except IOError:

      pass

atexit.register(readline.write_history_file,   histfile)

del os, histfile, readline, rlcompleter

 

         echo "export PYTHONSTARTUP=~/.pythonstartup" >> ~/.bashrc

         source /root/.bashrc

 


你可能感兴趣的:(python,tab,补齐)