python 添加tab支持及安装redis

添加tab支持

  1. tab内容:

vim tab.py

#! /usr/bin/python

import sys

import readline

import rlcompleter

import os

readline.parse_and_bind('tab: complete')

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


2.查看python遍历路径


>>> import sys

>>> sys.path

['', '/usr/local/pyhon2.7/lib/python2.7/site-packages/setuptools-18.4-py2.7.egg', '/usr/local/pyhon2.7/lib/python2.7/site-packages/readline-6.2.4.1-py2.7-linux-x86_64.egg', '/usr/local/pyhon2.7/lib/python2.7/site-packages/MySQL_python-1.2.3-py2.7-linux-x86_64.egg', '/usr/local/pyhon2.7/lib/python2.7/site-packages/paramiko-1.16.0-py2.7.egg', '/usr/local/pyhon2.7/lib/python2.7/site-packages/ecdsa-0.13-py2.7.egg', '/usr/local/pyhon2.7/lib/python2.7/site-packages/redis-2.10.5-py2.7.egg', '/usr/local/pyhon2.7/lib/python27.zip', '/usr/local/pyhon2.7/lib/python2.7', '/usr/local/pyhon2.7/lib/python2.7/plat-linux2', '/usr/local/pyhon2.7/lib/python2.7/lib-tk', '/usr/local/pyhon2.7/lib/python2.7/lib-old', '/usr/local/pyhon2.7/lib/python2.7/lib-dynload', '/usr/local/pyhon2.7/lib/python2.7/site-packages']


3.将文件加入到遍历路径即可

mv tab.py /usr/local/pyhon2.7/lib/python2.7/site-packages/


安装redis

下载路径:https://github.com/andymccurdy/redis-py

unzip redis-py-master.zip 

cd redis-py-master

python setup.py install

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