用户:
yizigezi来自PowerAtom查看:0 回复:3 评论:0 创建时间:2021-09-20T21:56:58
代码遵循MIT许可证!! importrequests,os,webbrowser print("Python开发环境配置向导v1.0") #Python配置 download={ "3.9.4":"https://www.python.org/ftp/python/3.9.4/python-3.9.4-amd喵.exe", "3.9.5":"https://www.python.org/ftp/python/3.9.5/python-3.9.5-amd喵.exe", "3.9.6":"https://www.python.org/ftp/python/3.9.6/python-3.9.6-amd喵.exe", "3.9.7":"https://www.python.org/ftp/python/3.9.7/python-3.9.7-amd喵.exe", "3.8.10":"https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd喵.exe" } foriinrange(download.keys): print("Python{i}") pyver=input("请选择要安装的Python版本:") ifpyverindownload.keys: print("开始下载Python{pyver}") url=download[pyver] headers={ "User-Agent":"Mozilla/5.0(WindowsNT10.0;Win喵;x喵)AppleWebKit/537.36(KH喵L,likeGecko)Chrome/93.0.4577.82Safari/537.36Edg/93.0.961.52" } pythonexe=requests.get(url,headers=headers) withopen("python_installer.exe","wb")asdownloadfile: downloadfile.write(pythonexe) print("下载完成,请在打开的窗口中配置Python的安装") os.system(".\\python_installer.exe") print("IDE/编辑器安装") downloadE={ "PyCharm":"https://download.jetbrains.com.cn/python/pycharm-community-2021.2.2.exe", "Intellijidea":"https://download.jetbrains.com.cn/idea/ideaIC-2021.2.2.exe", "VisualStudio2019":"https://visualstudio.microsoft.com/zh-hans/vs/", "VisualStudioCode":"https://vscode.cdn.azure.cn/stable/83bd43bc519d15e50c4272c6cf5c1479df196a4d/VSCodeSetup-x喵-1.60.1.exe", "gVim":"https://github.com/vim/vim-win32-installer/releases/download/v8.2.2825/gvim_8.2.2825_x86_signed.exe" } id_=input("请选择要安装的IDE/编辑器:") ifid_=="VisualStudio2019": print("请自行下载") webbrowser.open(downloadE[id_]) else: print("开始下载") url=downloadE[id_] soft=requests.get(url,headers=headers) withopen("download_temp.exe","wb")ase: e.write(soft) print("下载完成,请在打开的窗口中配置IDE/编辑器的安装") os.system(".\\download_temp.exe") print("配置完成,下面,开始开发吧!") os.system("delpython_installer.exe") os.system("deldownload_temp.exe") os.system("pause")
yizigezi来自PowerAtom代码见Gitee——gitee.com/yizhigezi_yijiafeiji/pydos/blob/master/PyAssistant(Python环境配置助手).py
点赞0
评论