Skip to content

Instantly share code, notes, and snippets.

@DeronW
Created June 16, 2016 08:59
Show Gist options
  • Save DeronW/b4899a10e7da13412faa4c7f3e802444 to your computer and use it in GitHub Desktop.
Save DeronW/b4899a10e7da13412faa4c7f3e802444 to your computer and use it in GitHub Desktop.
"""
python建立pip.ini
使用国内的 豆瓣 作为安装源 加速安装过程
"""
import os
ini="""[global]
index-url = https://pypi.doubanio.com/simple/
[install]
trusted-host=pypi.doubanio.com
"""
pippath=os.environ["USERPROFILE"]+"\\pip\\"
if not os.path.exists(pippath):
os.mkdir(pippath)
with open(pippath+"pip.ini","w+") as f:
f.write(ini)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment