#!/usr/bin/env python
-- coding: utf-8 --
import sys
import readline
import rlcompleter
if sys.platform == 'darwin' and sys.version_info[0] == 2:
readline.parse_and_bind("bind ^I rl_complete")
else:
readline.parse_and_bind("tab: complete") # linux and python3 on mac
本文转自cloves 51CTO博客,原文链接:http://blog.51cto.com/yeqing/2050780