Skip to content

Instantly share code, notes, and snippets.

@fire9
Last active December 27, 2017 15:39
Show Gist options
  • Save fire9/ee5e68008c221d1c3394a91fd131e071 to your computer and use it in GitHub Desktop.
Save fire9/ee5e68008c221d1c3394a91fd131e071 to your computer and use it in GitHub Desktop.
Mac Python 命令行补全

Mac Python 命令行补全

#!/usr/local/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment