在终端键入python 进入python后键入一下两行命令: >>> import rlcompleter, readline >>> readline.parse_and_bind('tab: complete')