• Easy Pypi更新!1.2.1发布


    非常的抱歉啊,这个底下的1.2.1呀,有一点错乱啊,可能是被某个人魔改了。。。

    以下是修复重发:

    import os
    import tkinter as tk
    import tkinter.ttk as ttk
    from tkinter.filedialog import askdirectory
    import webbrowser
    
    def init():
        global py_path,pip_path
        try:
            print('正在读取')
            py_path_f=open("./py_path.cfg",'r',encoding='utf-8')
            py_path=py_path_f.read()
            print(py_path)
            py_path_f.close()
            pip_path=py_path+"/scripts/pip.exe"
            print('读取完成')
            if py_path=='使用环境变量':
                print('使用环境变量')
                pip_path='pip'
        except Exception as e:
            print('读取设置失败:'+str(e))
            py_path=askdirectory(title='请选择Python安装路径')
            py_path_f=open("./py_path.cfg",'w',encoding='utf-8')
            py_path_f.write(py_path)
            py_path_f.close()
            pip_path=py_path+"/scripts/pip.exe"
    
    def locate_pip():
        os.system("where pip")
        os.system("where pip3")
        print('==================================================')
    
    def install(name):
        os.system(pip_path+" install "+name+' -i https://pypi.douban.com/simple')
        print('==================================================')
    
    def uninstall():
        os.system(pip_path+" uninstall "+name)
        print('==================================================')
    
    def about():
        os.system(py_path+"/python.exe -m pip install --upgrade pip -i https://pypi.douban.com/simple")
        print('==================================================')
    
    def list_pkg():
        os.system(pip_path+" list")
        print('==================================================')
    
    def upgrade():
        os.system(pip_path+" --version")
        print('==================================================')
        
    
    win=tk.Tk()
    win.title('Easy Pypi V1.2.1')
    win.geometry('300x370')
    win.resizable(0,0)
    
    init()
    
    name_enter=ttk.Entry(win)
    name_enter.pack(fill=tk.X)
    
    print('执行:     '+pip_path+' install '+'(库名)'+' -i https://pypi.douban.com/simple')
    
    print('==================================================')
    
    ttk.Button(win,text='安装',command=lambda:install(name_enter.get())).pack(fill=tk.X)
    ttk.Button(win,text='卸载',command=uninstall).pack(fill=tk.X)
    ttk.Button(win,text='列出所有已经安装的库',command=list_pkg).pack(fill=tk.X)
    ttk.Button(win,text='更新PIP',command=about).pack(fill=tk.X)
    ttk.Button(win,text='关于PIP',command=upgrade).pack(fill=tk.X)
    ttk.Button(win,text='查看环境变量中有关PIP路径的配置',command=locate_pip).pack(fill=tk.X)
    
    tk.Label(win,text='介绍',bg='lightgrey').pack(fill=tk.X)
    tk.Label(win,text='这个程序可以方便地从Pypi安装第三方库').pack(fill=tk.X)
    tk.Label(win,text='默认使用豆瓣镜像源以提升速度').pack(fill=tk.X)
    
    tk.Label(win,text='使用步骤',bg='lightgrey').pack(fill=tk.X)
    tk.Label(win,text='1.在窗口顶部的输入框内输入库名').pack(fill=tk.X)
    tk.Label(win,text='2.点击点击相关的功能按钮').pack(fill=tk.X)
    tk.Label(win,text='3.等待操作完毕(不要关闭弹出的命令提示符)').pack(fill=tk.X)
    
    
    tk.Button(win,text='2022 By 人工智障',bg='lightgrey',bd=0,command=lambda:webbrowser.open("https://www.cnblogs.com/totowang")).pack(fill=tk.X)
    
    win.mainloop()

    真·一天不到

    主要是在列出所有已安装的库时修改参数使用PIP新版的列表视图

    import os
    import tkinter as tk
    import tkinter.ttk as ttk
    from tkinter.filedialog import askdirectory
    import webbrowser
    
    def init():
        global py_path,pip_path
        try:
            print('正在读取')
            py_path_f=open("./py_path.cfg",'r',encoding='utf-8')
            py_path=py_path_f.read()
            print(py_path)
            py_path_f.close()
            pip_path=py_path+"/scripts/pip.exe"
            print('读取完成')
            if py_path=='使用环境变量':
                print('使用环境变量')
                pip_path='pip'
        except Exception as e:
            print('读取设置失败:'+str(e))
            py_path=askdirectory(title='请选择Python安装路径')
            py_path_f=open("./py_path.cfg",'w',encoding='utf-8')
            py_path_f.write(py_path)
            py_path_f.close()
            pip_path=py_path+"/scripts/pip.exe"
    
    def locate_pip():
        os.system("where pip")
        os.system("where pip3")
        print('==================================================')
    
    def install(name):
        os.system(pip_path+" install "+name+' -i https://pypi.douban.com/simple')
        print('==================================================')
    
    def uninstall():
        os.system(pip_path+" uninstall "+name)
        print('==================================================')
    
    def about():
        os.system(py_path+"/python.exe -m pip install --upgrade pip -i https://pypi.douban.com/simple")
        print('==================================================')
    
    def list_pkg():
        os.system(pip_path+" list --format=columns")
        print('==================================================')
        
    
    win=tk.Tk()
    win.title('Easy Pypi V1.0 Beta')
    win.geometry('300x370')
    win.resizable(0,0)
    
    init()
    
    print('==================================================')
    
    name_enter=ttk.Entry(win)
    name_enter.pack(fill=tk.X)
    
    print('执行:     '+pip_path+' install '+'(库名)'+' -i https://pypi.douban.com/simple')
    
    ttk.Button(win,text='安装',command=lambda:install(name_enter.get())).pack(fill=tk.X)
    ttk.Button(win,text='卸载',command=uninstall).pack(fill=tk.X)
    ttk.Button(win,text='列出所有已经安装的库',command=list_pkg).pack(fill=tk.X)
    ttk.Button(win,text='更新PIP',command=about).pack(fill=tk.X)
    ttk.Button(win,text='关于PIP',command=lambda:os.system(pip_path+" --version")).pack(fill=tk.X)
    ttk.Button(win,text='查看环境变量中有关PIP路径的配置',command=locate_pip).pack(fill=tk.X)
    
    tk.Label(win,text='介绍',bg='lightgrey').pack(fill=tk.X)
    tk.Label(win,text='这个程序可以方便地从Pypi安装第三方库').pack(fill=tk.X)
    tk.Label(win,text='默认使用豆瓣镜像源以提升速度').pack(fill=tk.X)
    
    tk.Label(win,text='使用步骤',bg='lightgrey').pack(fill=tk.X)
    tk.Label(win,text='1.在窗口顶部的输入框内输入库名').pack(fill=tk.X)
    tk.Label(win,text='2.点击点击相关的功能按钮').pack(fill=tk.X)
    tk.Label(win,text='3.等待操作完毕(不要关闭弹出的命令提示符)').pack(fill=tk.X)
    
    
    tk.Button(win,text='2022 By 人工智障',bg='lightgrey',bd=0,command=lambda:webbrowser.open("https://www.cnblogs.com/totowang")).pack(fill=tk.X)
    
    win.mainloop()
  • 相关阅读:
    什么是超参数
    KNN算法(K近邻算法)实现与剖析
    pandas中na_values与keep_default_na
    一篇文章搞懂python2、3编码
    深度学习基础篇之逻辑回归拟合二维数据
    采集万方医药方向的期刊+文章+作者信息(数据量千万级)
    win10安装tensorflow (cpu版)
    内存文件的读写
    海康威视面试python后端题
    Scrapy 采集需要登录注册的网站
  • 原文地址:https://www.cnblogs.com/TotoWang/p/easy_pypi_1_2_1.html
Copyright © 2020-2023  润新知