1 """
 2 python建立pip.ini Aliyun源
 3 2020年5月3日20:28:50 Venti Fang
 4 """
 5 
 6 import os
 7 
 8 ini = """
 9 [global]
10 index-url = https://mirrors.aliyun.com/simple/
11 [install]
12 trusted-host=mirrors.aliyun.com
13 """
14 pippath = os.environ["USERPROFILE"] + "\\pip\\"  #C:\Users\84788\pip\
15 # print(pippath)
16 if not os.path.exists(pippath):
17     os.mkdir(pippath)
18 
19 with open(pippath + "pip.ini", "w+") as f:
20     f.write(ini)

 

版权声明:本文为tingguoguoyo原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/tingguoguoyo/p/12823378.html