文章目录
使用场景:
经常使用Pycharm中过程中要安装或卸载一些包,尤其在安装过程中经常会遇到网络问题下载失败,然后在终端输入第三方镜像源来下载。有没有一种方式,不需要每次输镜像源地址又有快速下载第三方库包呢,而且有界面可以进行操作。
设计思路:
1、输入库名,安装和卸载第三方库包
2、安装时指定第三方库镜像源,再也不用手动每次输入镜像源
# -*- coding: utf-8 -*-
# @Author : 無涯
import tkinter as tk
from tkinter import messagebox
import subprocess
import sys
import os
def center_window(root, width, height):
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
x = (screen_width // 2) - (width // 2)
y = (screen_height // 2) - (height // 2)
root.geometry(f'{
width}x{
height}+