国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Python tkinker 界面設(shè)計(jì)與圖標(biāo)設(shè)置和圖片文件打包成單個(gè)exe

這篇具有很好參考價(jià)值的文章主要介紹了Python tkinker 界面設(shè)計(jì)與圖標(biāo)設(shè)置和圖片文件打包成單個(gè)exe。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

1.? python 打包圖片資源文件和邏輯文件,以及桌面應(yīng)用圖標(biāo)

pyinstaller -F ae_awb_tool.py ?-p png_resource.py -i 1.ico -w

?2. 完整代碼如下。其作用是調(diào)用MTK 研發(fā)的圖片信息dump工具,對(duì)圖片AE 和AWB 進(jìn)行分析歸類到所屬的目錄中,并統(tǒng)計(jì)目錄下文件個(gè)數(shù),填充到最后一級(jí)文件夾名稱開(kāi)頭。

3. 將圖片文件轉(zhuǎn)換為 py文件的腳本


import base64
import tkinter.messagebox as msgbox
def picture_to_py(pic_name):
    convert_pic_past = open("%s" % pic_name, 'rb')  # 這里傳入要轉(zhuǎn)換的圖片
    base64_convert_str = base64.b64encode(convert_pic_past.read())  # base64讀取(字符串)
    convert_pic_past.close() # 關(guān)閉讀取
    convert_write_data = 'img = "%s"' % base64_convert_str.decode() # 處理
    a = open('%s.py' % pic_name.replace('.', '_'), 'w+')
    a.write(convert_write_data)
    a.close()
 
if __name__ == '__main__':
    picture = ["PCBico.png"]  # 寫入你要轉(zhuǎn)換的文件名,建議把該代碼保存到與轉(zhuǎn)換圖片相同路徑下
    for x in picture:
        picture_to_py(x)
    msgbox.showinfo("tip", "convert successfully.")
————————————————
版權(quán)聲明:本文為CSDN博主「lagesan」的原創(chuàng)文章,遵循CC 4.0 BY-SA版權(quán)協(xié)議,轉(zhuǎn)載請(qǐng)附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/lagesan/article/details/128415788

4. 主邏輯腳本內(nèi)容如下:?

#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os,base64
from tkinter.messagebox import showinfo
import matplotlib.pyplot as plt
import numpy as np
import subprocess
import datetime
import re
from png_resource import img as img_pic
import tkinter as tk
from tkinter import filedialog

import shutil

starttime = datetime.datetime.now()

global debug_Tool
global photopath
def select_tool_dir():
    global debug_Tool
    debug_entry.set("")
    debug_Tool = filedialog.askopenfile(initialdir=os.getcwd()).name
    if debug_Tool.endswith("DebugParser.exe"):
        debug_entry.set(debug_Tool)
    if os.path.exists(os.getcwd()+"\default_path.txt")  == False:
        with open(os.getcwd() + "\default_path.txt", 'w+') as f_default_path:
            f_default_path.close()
    with open(os.getcwd()+"\default_path.txt", 'r+') as f_default_path:
        lines = f_default_path.readlines()
        file_contents = []
        for line in lines:
            if line.startswith("tool_deault_dir=") == False:
                file_contents.append(line)
        f_default_path.seek(0)
        for content in file_contents:
            f_default_path.write(content)
        path_str = "tool_deault_dir=" + debug_Tool+'\n'
        f_default_path.write(path_str)
        f_default_path.close()

def select_picture_path():
    global photopath
    photo_entry.set("")
    photopath = filedialog.askdirectory(initialdir=os.getcwd())  # 使用askdirectory函數(shù)選擇文件夾
    photopath += "/"
    photo_entry.set(photopath)

    if os.path.exists(os.getcwd()+"\default_path.txt")  == False:
        with open(os.getcwd() + "\default_path.txt", 'w+') as f_default_path:
            f_default_path.close()
    with open(os.getcwd() + "\default_path.txt", 'r+') as f_default_path:
        lines = f_default_path.readlines()
        file_contents = []
        for line in lines:
            if line.startswith("photo_deault_dir=") == False:
                file_contents.append(line)
        f_default_path.seek(0)
        for content in file_contents:
            f_default_path.write(content)
        path_str = "photo_deault_dir=" + photopath+'\n'
        f_default_path.write(path_str)
        f_default_path.close()



def analyse(exifpath):
    data = {
        "name": str,
        "AE_TAG_REALBVX1000": str,
        "AE_TAG_HS_EVD": str,
        "AE_TAG_FACE_STS_SIZE": str,
        "AE_TAG_FLT_DR": str,
        "AE_TAG_FLT_FDY": str
    }

    AE_TAG_REALBVX1000 = []
    AE_TAG_HS_EVD = []
    AE_TAG_FACE_STS_SIZE = []
    AE_TAG_FLT_DR = []
    AE_TAG_REALBVX1000_Normal = []
    AE_TAG_HS_EVD_Normal = []
    # exif 目錄

    result = {
        # 無(wú)人臉
        "bv -∞~-1500 & evd -∞~1000": [0, []],
        "bv -∞~-1500 & evd 1000~4200": [0, []],
        "bv -∞~-1500 & evd 4200~6300": [0, []],
        "bv -∞~-1500 & evd 6300+": [0, []],

        "bv -1500~500 & evd -∞~1000": [0, []],
        "bv -1500~500 & evd 1000~4200": [0, []],
        "bv -1500~500 & evd 4200~6300": [0, []],
        "bv -1500~500 & evd 6300+": [0, []],

        "bv 500~2500 & evd -∞~1000": [0, []],
        "bv 500~2500 & evd 1000~4200": [0, []],
        "bv 500~2500 & evd 4200~6300": [0, []],
        "bv 500~2500 & evd 6300+": [0, []],

        "bv 2500~5000 & evd -∞~1000": [0, []],
        "bv 2500~5000 & evd 1000~4200": [0, []],
        "bv 2500~5000 & evd 4200~6300": [0, []],
        "bv 2500~5000 & evd 6300+": [0, []],

        "bv 5000~8000 & evd -∞~1000": [0, []],
        "bv 5000~8000 & evd 1000~4200": [0, []],
        "bv 5000~8000 & evd 4200~6300": [0, []],
        "bv 5000~8000 & evd 6300+": [0, []],

        "bv 8000~10000 & evd -∞~1000": [0, []],
        "bv 8000~10000 & evd 1000~4200": [0, []],
        "bv 8000~10000 & evd 4200~6300": [0, []],
        "bv 8000~10000 & evd 6300+": [0, []],

        "bv 10000+ & evd -∞~1000": [0, []],
        "bv 10000+ & evd 1000~4200": [0, []],
        "bv 10000+ & evd 4200~6300": [0, []],
        "bv 10000+ & evd 6300+": [0, []],

        # 人臉
        "bv -∞~-2000 & fdr -∞~0": [0, []],
        "bv -∞~-2000 & fdr 0~1800": [0, []],
        "bv -∞~-2000 & fdr 1800~2800": [0, []],
        "bv -∞~-2000 & fdr 2800~4000": [0, []],
        "bv -∞~-2000 & fdr 4000+": [0, []],

        "bv -2000~0 & fdr -∞~0": [0, []],
        "bv -2000~0 & fdr 0~1800": [0, []],
        "bv -2000~0 & fdr 1800~2800": [0, []],
        "bv -2000~0 & fdr 2800~4000": [0, []],
        "bv -2000~0 & fdr 4000+": [0, []],

        "bv 0~3000 & fdr -∞~0": [0, []],
        "bv 0~3000 & fdr 0~1800": [0, []],
        "bv 0~3000 & fdr 1800~2800": [0, []],
        "bv 0~3000 & fdr 2800~4000": [0, []],
        "bv 0~3000 & fdr 4000+": [0, []],

        "bv 3000~6000 & fdr -∞~0": [0, []],
        "bv 3000~6000 & fdr 0~1800": [0, []],
        "bv 3000~6000 & fdr 1800~2800": [0, []],
        "bv 3000~6000 & fdr 2800~4000": [0, []],
        "bv 3000~6000 & fdr 4000+": [0, []],

        "bv 6000~8500 & fdr -∞~0": [0, []],
        "bv 6000~8500 & fdr 0~1800": [0, []],
        "bv 6000~8500 & fdr 1800~2800": [0, []],
        "bv 6000~8500 & fdr 2800~4000": [0, []],
        "bv 6000~8500 & fdr 4000+": [0, []],

        "bv 8500+ & fdr -∞~0": [0, []],
        "bv 8500+ & fdr 0~1800": [0, []],
        "bv 8500+ & fdr 1800~2800": [0, []],
        "bv 8500+ & fdr 2800~4000": [0, []],
        "bv 8500+ & fdr 4000+": [0, []],

    }

    with open(exifpath + "SearchResult.exif", 'r') as ef:
        lines = ef.readlines()
    count = 0
    # 拿到每一個(gè)exif中需要的信息 放在data中

    for line in lines:

        count += 1
        # 取每一張圖片的信息 放在data中
        if count % 8 != 0:
            if ".jpg" in line:
                data["name"] = re.findall(r"[\[](.*?)[\]]", line)[0]
                name = photopath.split("/")[-2]
            elif line != "\n":
                dataname = line.split(":")[0].replace(" ", "")
                value = line.split(":")[1].replace(" ", "").replace("\n", "")
                data[dataname] = value
        else:
            # 判斷每個(gè)exif的區(qū)域信息
            if int(data["AE_TAG_FACE_STS_SIZE"]) > 13 and int(data["AE_TAG_FLT_FDY"]) != 0:
                if 0 > int(data['AE_TAG_FLT_DR']) and -2000 > int(data['AE_TAG_REALBVX1000']):
                    result['bv -∞~-2000 & fdr -∞~0'][0] += 1
                    result['bv -∞~-2000 & fdr -∞~0'][1].append(data["name"])
                if 1800 > int(data['AE_TAG_FLT_DR']) >= 0 and -2000 > int(data['AE_TAG_REALBVX1000']):
                    result['bv -∞~-2000 & fdr 0~1800'][0] += 1
                    result['bv -∞~-2000 & fdr 0~1800'][1].append(data["name"])
                if 2800 > int(data['AE_TAG_FLT_DR']) >= 1800 and -2000 > int(data['AE_TAG_REALBVX1000']):
                    result['bv -∞~-2000 & fdr 1800~2800'][0] += 1
                    result['bv -∞~-2000 & fdr 1800~2800'][1].append(data["name"])
                if 4000 > int(data['AE_TAG_FLT_DR']) >= 2800 and -2000 > int(data['AE_TAG_REALBVX1000']):
                    result['bv -∞~-2000 & fdr 2800~4000'][0] += 1
                    result['bv -∞~-2000 & fdr 2800~4000'][1].append(data["name"])
                if int(data['AE_TAG_FLT_DR']) >= 4000 and -2000 > int(data['AE_TAG_REALBVX1000']):
                    result['bv -∞~-2000 & fdr 4000+'][0] += 1
                    result['bv -∞~-2000 & fdr 4000+'][1].append(data["name"])

                if 0 > int(data['AE_TAG_FLT_DR']) and 0 > int(data['AE_TAG_REALBVX1000']) >= -2000:
                    result['bv -2000~0 & fdr -∞~0'][0] += 1
                    result['bv -2000~0 & fdr -∞~0'][1].append(data["name"])
                if 1800 > int(data['AE_TAG_FLT_DR']) >= 0 and 0 > int(data['AE_TAG_REALBVX1000']) >= -2000:
                    result['bv -2000~0 & fdr 0~1800'][0] += 1
                    result['bv -2000~0 & fdr 0~1800'][1].append(data["name"])
                if 2800 > int(data['AE_TAG_FLT_DR']) >= 1800 and 0 > int(data['AE_TAG_REALBVX1000']) >= -2000:
                    result['bv -2000~0 & fdr 1800~2800'][0] += 1
                    result['bv -2000~0 & fdr 1800~2800'][1].append(data["name"])
                if 4000 > int(data['AE_TAG_FLT_DR']) >= 2800 and 0 > int(data['AE_TAG_REALBVX1000']) >= -2000:
                    result['bv -2000~0 & fdr 2800~4000'][0] += 1
                    result['bv -2000~0 & fdr 2800~4000'][1].append(data["name"])
                if int(data['AE_TAG_FLT_DR']) >= 4000 and 0 > int(data['AE_TAG_REALBVX1000']) >= -2000:
                    result['bv -2000~0 & fdr 4000+'][0] += 1
                    result['bv -2000~0 & fdr 4000+'][1].append(data["name"])

                if 0 > int(data['AE_TAG_FLT_DR']) and 3000 > int(data['AE_TAG_REALBVX1000']) >= 0:
                    result['bv 0~3000 & fdr -∞~0'][0] += 1
                    result['bv 0~3000 & fdr -∞~0'][1].append(data["name"])
                if 1800 > int(data['AE_TAG_FLT_DR']) >= 0 and 3000 > int(data['AE_TAG_REALBVX1000']) >= 0:
                    result['bv 0~3000 & fdr 0~1800'][0] += 1
                    result['bv 0~3000 & fdr 0~1800'][1].append(data["name"])
                if 2800 > int(data['AE_TAG_FLT_DR']) >= 1800 and 3000 > int(data['AE_TAG_REALBVX1000']) >= 0:
                    result['bv 0~3000 & fdr 1800~2800'][0] += 1
                    result['bv 0~3000 & fdr 1800~2800'][1].append(data["name"])
                if 4000 > int(data['AE_TAG_FLT_DR']) >= 2800 and 3000 > int(data['AE_TAG_REALBVX1000']) >= 0:
                    result['bv 0~3000 & fdr 2800~4000'][0] += 1
                    result['bv 0~3000 & fdr 2800~4000'][1].append(data["name"])
                if int(data['AE_TAG_FLT_DR']) >= 4000 and 3000 > int(data['AE_TAG_REALBVX1000']) >= 0:
                    result['bv 0~3000 & fdr 4000+'][0] += 1
                    result['bv 0~3000 & fdr 4000+'][1].append(data["name"])

                if 0 > int(data['AE_TAG_FLT_DR']) and 6000 > int(data['AE_TAG_REALBVX1000']) >= 3000:
                    result['bv 3000~6000 & fdr -∞~0'][0] += 1
                    result['bv 3000~6000 & fdr -∞~0'][1].append(data["name"])
                if 1800 > int(data['AE_TAG_FLT_DR']) >= 0 and 6000 > int(data['AE_TAG_REALBVX1000']) >= 3000:
                    result['bv 3000~6000 & fdr 0~1800'][0] += 1
                    result['bv 3000~6000 & fdr 0~1800'][1].append(data["name"])
                if 2800 > int(data['AE_TAG_FLT_DR']) >= 1800 and 6000 > int(data['AE_TAG_REALBVX1000']) >= 3000:
                    result['bv 3000~6000 & fdr 1800~2800'][0] += 1
                    result['bv 3000~6000 & fdr 1800~2800'][1].append(data["name"])
                if 4000 > int(data['AE_TAG_FLT_DR']) >= 2800 and 6000 > int(data['AE_TAG_REALBVX1000']) >= 3000:
                    result['bv 3000~6000 & fdr 2800~4000'][0] += 1
                    result['bv 3000~6000 & fdr 2800~4000'][1].append(data["name"])
                if int(data['AE_TAG_FLT_DR']) >= 4000 and 6000 > int(data['AE_TAG_REALBVX1000']) >= 3000:
                    result['bv 3000~6000 & fdr 4000+'][0] += 1
                    result['bv 3000~6000 & fdr 4000+'][1].append(data["name"])

                if 0 > int(data['AE_TAG_FLT_DR']) and 8500 > int(data['AE_TAG_REALBVX1000']) >= 6000:
                    result['bv 6000~8500 & fdr -∞~0'][0] += 1
                    result['bv 6000~8500 & fdr -∞~0'][1].append(data["name"])
                if 1800 > int(data['AE_TAG_FLT_DR']) >= 0 and 8500 > int(data['AE_TAG_REALBVX1000']) >= 6000:
                    result['bv 6000~8500 & fdr 0~1800'][0] += 1
                    result['bv 6000~8500 & fdr 0~1800'][1].append(data["name"])
                if 2800 > int(data['AE_TAG_FLT_DR']) >= 1800 and 8500 > int(data['AE_TAG_REALBVX1000']) >= 6000:
                    result['bv 6000~8500 & fdr 1800~2800'][0] += 1
                    result['bv 6000~8500 & fdr 1800~2800'][1].append(data["name"])
                if 4000 > int(data['AE_TAG_FLT_DR']) >= 2800 and 8500 > int(data['AE_TAG_REALBVX1000']) >= 6000:
                    result['bv 6000~8500 & fdr 2800~4000'][0] += 1
                    result['bv 6000~8500 & fdr 2800~4000'][1].append(data["name"])
                if int(data['AE_TAG_FLT_DR']) >= 4000 and 8500 > int(data['AE_TAG_REALBVX1000']) >= 6000:
                    result['bv 6000~8500 & fdr 4000+'][0] += 1
                    result['bv 6000~8500 & fdr 4000+'][1].append(data["name"])

                if 0 > int(data['AE_TAG_FLT_DR']) and int(data['AE_TAG_REALBVX1000']) >= 8500:
                    result['bv 8500+ & fdr -∞~0'][0] += 1
                    result['bv 8500+ & fdr -∞~0'][1].append(data["name"])
                if 1800 > int(data['AE_TAG_FLT_DR']) >= 0 and int(data['AE_TAG_REALBVX1000']) >= 8500:
                    result['bv 8500+ & fdr 0~1800'][0] += 1
                    result['bv 8500+ & fdr 0~1800'][1].append(data["name"])
                if 2800 > int(data['AE_TAG_FLT_DR']) >= 1800 and int(data['AE_TAG_REALBVX1000']) >= 8500:
                    result['bv 8500+ & fdr 1800~2800'][0] += 1
                    result['bv 8500+ & fdr 1800~2800'][1].append(data["name"])
                if 4000 > int(data['AE_TAG_FLT_DR']) >= 2800 and int(data['AE_TAG_REALBVX1000']) >= 8500:
                    result['bv 8500+ & fdr 2800~4000'][0] += 1
                    result['bv 8500+ & fdr 2800~4000'][1].append(data["name"])
                if int(data['AE_TAG_FLT_DR']) >= 4000 and int(data['AE_TAG_REALBVX1000']) >= 8500:
                    result['bv 8500+ & fdr 4000+'][0] += 1
                    result['bv 8500+ & fdr 4000+'][1].append(data["name"])

            else:
                if 1000 > int(data['AE_TAG_HS_EVD']) and -1500 > int(data['AE_TAG_REALBVX1000']):
                    result['bv -∞~-1500 & evd -∞~1000'][0] += 1
                    result['bv -∞~-1500 & evd -∞~1000'][1].append(data["name"])
                if 4200 > int(data['AE_TAG_HS_EVD']) >= 1000 and -1500 > int(data['AE_TAG_REALBVX1000']):
                    result['bv -∞~-1500 & evd 1000~4200'][0] += 1
                    result['bv -∞~-1500 & evd 1000~4200'][1].append(data["name"])
                if 6300 > int(data['AE_TAG_HS_EVD']) >= 4200 and -1500 > int(data['AE_TAG_REALBVX1000']):
                    result['bv -∞~-1500 & evd 4200~6300'][0] += 1
                    result['bv -∞~-1500 & evd 4200~6300'][1].append(data["name"])
                if int(data['AE_TAG_HS_EVD']) >= 6300 and -1500 > int(data['AE_TAG_REALBVX1000']):
                    result['bv -∞~-1500 & evd 6300+'][0] += 1
                    result['bv -∞~-1500 & evd 6300+'][1].append(data["name"])

                if 1000 > int(data['AE_TAG_HS_EVD']) and 500 > int(data['AE_TAG_REALBVX1000']) >= -1500:
                    result['bv -1500~500 & evd -∞~1000'][0] += 1
                    result['bv -1500~500 & evd -∞~1000'][1].append(data["name"])
                if 4200 > int(data['AE_TAG_HS_EVD']) >= 1000 and 500 > int(data['AE_TAG_REALBVX1000']) >= -1500:
                    result['bv -1500~500 & evd 1000~4200'][0] += 1
                    result['bv -1500~500 & evd 1000~4200'][1].append(data["name"])
                if 6300 > int(data['AE_TAG_HS_EVD']) >= 4200 and 500 > int(data['AE_TAG_REALBVX1000']) >= -1500:
                    result['bv -1500~500 & evd 4200~6300'][0] += 1
                    result['bv -1500~500 & evd 4200~6300'][1].append(data["name"])
                if int(data['AE_TAG_HS_EVD']) >= 6300 and 500 > int(data['AE_TAG_REALBVX1000']) >= -1500:
                    result['bv -1500~500 & evd 6300+'][0] += 1
                    result['bv -1500~500 & evd 6300+'][1].append(data["name"])

                if 1000 > int(data['AE_TAG_HS_EVD']) and 2500 > int(data['AE_TAG_REALBVX1000']) >= 500:
                    result['bv 500~2500 & evd -∞~1000'][0] += 1
                    result['bv 500~2500 & evd -∞~1000'][1].append(data["name"])
                if 4200 > int(data['AE_TAG_HS_EVD']) >= 1000 and 2500 > int(data['AE_TAG_REALBVX1000']) >= 500:
                    result['bv 500~2500 & evd 1000~4200'][0] += 1
                    result['bv 500~2500 & evd 1000~4200'][1].append(data["name"])
                if 6300 > int(data['AE_TAG_HS_EVD']) >= 4200 and 2500 > int(data['AE_TAG_REALBVX1000']) >= 500:
                    result['bv 500~2500 & evd 4200~6300'][0] += 1
                    result['bv 500~2500 & evd 4200~6300'][1].append(data["name"])
                if int(data['AE_TAG_HS_EVD']) >= 6300 and 2500 > int(data['AE_TAG_REALBVX1000']) >= 500:
                    result['bv 500~2500 & evd 6300+'][0] += 1
                    result['bv 500~2500 & evd 6300+'][1].append(data["name"])

                if 1000 > int(data['AE_TAG_HS_EVD']) and 5000 > int(data['AE_TAG_REALBVX1000']) >= 2500:
                    result['bv 2500~5000 & evd -∞~1000'][0] += 1
                    result['bv 2500~5000 & evd -∞~1000'][1].append(data["name"])
                if 4200 > int(data['AE_TAG_HS_EVD']) >= 1000 and 5000 > int(data['AE_TAG_REALBVX1000']) >= 2500:
                    result['bv 2500~5000 & evd 1000~4200'][0] += 1
                    result['bv 2500~5000 & evd 1000~4200'][1].append(data["name"])
                if 6300 > int(data['AE_TAG_HS_EVD']) >= 4200 and 5000 > int(data['AE_TAG_REALBVX1000']) >= 2500:
                    result['bv 2500~5000 & evd 4200~6300'][0] += 1
                    result['bv 2500~5000 & evd 4200~6300'][1].append(data["name"])
                if int(data['AE_TAG_HS_EVD']) >= 6300 and 5000 > int(data['AE_TAG_REALBVX1000']) >= 2500:
                    result['bv 2500~5000 & evd 6300+'][0] += 1
                    result['bv 2500~5000 & evd 6300+'][1].append(data["name"])

                if 1000 > int(data['AE_TAG_HS_EVD']) and 8000 > int(data['AE_TAG_REALBVX1000']) >= 5000:
                    result['bv 5000~8000 & evd -∞~1000'][0] += 1
                    result['bv 5000~8000 & evd -∞~1000'][1].append(data["name"])
                if 4200 > int(data['AE_TAG_HS_EVD']) >= 1000 and 8000 > int(data['AE_TAG_REALBVX1000']) >= 5000:
                    result['bv 5000~8000 & evd 1000~4200'][0] += 1
                    result['bv 5000~8000 & evd 1000~4200'][1].append(data["name"])
                if 6300 > int(data['AE_TAG_HS_EVD']) >= 4200 and 8000 > int(data['AE_TAG_REALBVX1000']) >= 5000:
                    result['bv 5000~8000 & evd 4200~6300'][0] += 1
                    result['bv 5000~8000 & evd 4200~6300'][1].append(data["name"])
                if int(data['AE_TAG_HS_EVD']) >= 6300 and 8000 > int(data['AE_TAG_REALBVX1000']) >= 5000:
                    result['bv 5000~8000 & evd 6300+'][0] += 1
                    result['bv 5000~8000 & evd 6300+'][1].append(data["name"])

                if 1000 > int(data['AE_TAG_HS_EVD']) and 10000 > int(data['AE_TAG_REALBVX1000']) >= 8000:
                    result['bv 8000~10000 & evd -∞~1000'][0] += 1
                    result['bv 8000~10000 & evd -∞~1000'][1].append(data["name"])
                if 4200 > int(data['AE_TAG_HS_EVD']) >= 1000 and 10000 > int(data['AE_TAG_REALBVX1000']) >= 8000:
                    result['bv 8000~10000 & evd 1000~4200'][0] += 1
                    result['bv 8000~10000 & evd 1000~4200'][1].append(data["name"])
                if 6300 > int(data['AE_TAG_HS_EVD']) >= 4200 and 10000 > int(data['AE_TAG_REALBVX1000']) >= 8000:
                    result['bv 8000~10000 & evd 4200~6300'][0] += 1
                    result['bv 8000~10000 & evd 4200~6300'][1].append(data["name"])
                if int(data['AE_TAG_HS_EVD']) >= 6300 and 10000 > int(data['AE_TAG_REALBVX1000']) >= 8000:
                    result['bv 8000~10000 & evd 6300+'][0] += 1
                    result['bv 8000~10000 & evd 6300+'][1].append(data["name"])

                if 1000 > int(data['AE_TAG_HS_EVD']) and int(data['AE_TAG_REALBVX1000']) >= 10000:
                    result['bv 10000+ & evd -∞~1000'][0] += 1
                    result['bv 10000+ & evd -∞~1000'][1].append(data["name"])
                if 4200 > int(data['AE_TAG_HS_EVD']) >= 1000 and int(data['AE_TAG_REALBVX1000']) >= 10000:
                    result['bv 10000+ & evd 1000~4200'][0] += 1
                    result['bv 10000+ & evd 1000~4200'][1].append(data["name"])
                if 6300 > int(data['AE_TAG_HS_EVD']) >= 4200 and int(data['AE_TAG_REALBVX1000']) >= 10000:
                    result['bv 10000+ & evd 4200~6300'][0] += 1
                    result['bv 10000+ & evd 4200~6300'][1].append(data["name"])
                if int(data['AE_TAG_HS_EVD']) >= 6300 and int(data['AE_TAG_REALBVX1000']) >= 10000:
                    result['bv 10000+ & evd 6300+'][0] += 1
                    result['bv 10000+ & evd 6300+'][1].append(data["name"])

            # 把這一個(gè)exif放數(shù)組中
            if int(data['AE_TAG_FACE_STS_SIZE']) > 13 and int(data["AE_TAG_FLT_FDY"]) != 0:
                AE_TAG_REALBVX1000.append(data['AE_TAG_REALBVX1000'])
                AE_TAG_FLT_DR.append(data['AE_TAG_FLT_DR'])
            else:
                AE_TAG_REALBVX1000_Normal.append(data['AE_TAG_REALBVX1000'])
                AE_TAG_HS_EVD_Normal.append(data['AE_TAG_HS_EVD'])



    return result, name, AE_TAG_HS_EVD_Normal, AE_TAG_REALBVX1000_Normal, AE_TAG_REALBVX1000,AE_TAG_FLT_DR,


def run_AE():
    global photopath
    result_CCT = [ "CCT  -∞  ~  2300", "CCT =2300 ~ 2850", "CCT =2850 ~ 3750",
                   "CCT =3750 ~ 5100", "CCT =5100 ~ 6500", "CCT =6500 ~   ∞"]
    for cct_key in result_CCT:
        dir_name = photopath + "\\" + cct_key
        if os.path.isdir(dir_name):
            shutil.rmtree(dir_name)
    result_AE=["Face","Normal"]
    for cct_key in result_AE:
        dir_name = photopath + "\\" + cct_key
        if os.path.isdir(dir_name):
            shutil.rmtree(dir_name)
    # child = subprocess.Popen(f"{debug} -dump {photopath}  -find \"AE_TAG_HS_EVD|AE_TAG_REALBVX1000|AE_TAG_FACE_STS_SIZE|AE_TAG_FLT_DR\" -save {photopath}/exif/")
    child1 = subprocess.Popen(
        f"{debug_Tool} -dump {photopath} -find \"AE_TAG_HS_EVD|AE_TAG_REALBVX1000|AE_TAG_FACE_STS_SIZE|AE_TAG_FLT_DR|AE_TAG_FLT_FDY\" -save {photopath}/")

    child1.wait()

    result,name, AE_TAG_HS_EVD_Normal, AE_TAG_REALBVX1000_Normal, AE_TAG_REALBVX1000,AE_TAG_FLT_DR, = analyse(photopath)


    os.mkdir(photopath + "Face")
    os.mkdir(photopath + "Normal")

    for dirname in result:
        if not os.path.exists(str(result[dirname][0]) + "  " + dirname.replace(" ", " ")):
            os.mkdir(photopath + str(result[dirname][0]) + "  " + dirname.replace(" ", " "))

    for photoname in os.listdir(photopath):
        for dirname in result:
            if photoname in result[dirname][1]:
                shutil.copyfile(photopath + photoname,
                                photopath + str(result[dirname][0]) + "  " + dirname.replace(" ",
                                                                                             " ") + f"/{photoname}")

    # 幫助跳出外層循環(huán)
    switchflag = True
    for dirpath, dirnames, filenames in os.walk(photopath):
        if switchflag:
            break
    for dirname in dirnames:
        if dirname == "Face" or dirname == "Normal":
            switchflag = False
            break
        if "evd" in dirname:
            shutil.move(photopath + dirname, photopath + "Normal")
        if "fdr" in dirname:
            shutil.move(photopath + dirname, photopath + "Face")

    x = len(AE_TAG_FLT_DR)
    y = len(AE_TAG_HS_EVD_Normal)
    result1 = '{:.2%}'.format(x / (x + y))
    result2 = '{:.2%}'.format(y / (x + y))

    ##繪制Normal散點(diǎn)圖表
    x_bv = np.asarray(AE_TAG_REALBVX1000_Normal, dtype=int)
    y_evd = np.asarray(AE_TAG_HS_EVD_Normal, dtype=int)


    my_x_ticks = [-1500, 500, 2500, 5000, 8000, 10000]
    my_y_ticks = [0, 1000, 4200, 6300]
    plt.xlim(-8000, 15000)
    plt.ylim(-5000, 10000)
    plt.xticks(ticks=my_x_ticks)
    plt.yticks(ticks=my_y_ticks)
    # 設(shè)置圖表標(biāo)題并給坐標(biāo)軸加上標(biāo)簽
    plt.title(f'{name} Normal:{y}/{x + y}  {result2}', fontsize=24)
    plt.xlabel('AE_TAG_REALBVX1000', fontsize=14)
    plt.ylabel('AE_TAG_HS_EVD', fontsize=14)
    plt.scatter(x_bv, y_evd, s=30,label="pic")

    plt.legend()
    plt.savefig(f'{photopath}Normal/result_Normal.png', dpi=300)
    plt.close()


    ##繪制Face散點(diǎn)圖
    x_bv = np.asarray(AE_TAG_REALBVX1000, dtype=int)
    y_dr = np.asarray(AE_TAG_FLT_DR, dtype=int)

    my_x_ticks = [-2000, 0, 3000, 6000, 8500]
    my_y_ticks = [0, 1800, 2800, 4000]
    plt.xlim(-8000, 15000)
    plt.ylim(-2000, 8000)
    plt.xticks(my_x_ticks)
    plt.yticks(my_y_ticks)
    # 設(shè)置圖表標(biāo)題并給坐標(biāo)軸加上標(biāo)簽

    plt.title(f'{name} Face:{x}/{x + y}  {result1}', fontsize=24)
    plt.xlabel('AE_TAG_REALBVX1000', fontsize=14)
    plt.ylabel('AE_TAG_FLT_DR', fontsize=14)
    plt.scatter(x_bv, y_dr, s=20, label="pic")

    plt.legend()
    plt.savefig(f'{photopath}Face/result_Face.png', dpi=300)
    plt.close()
    endtime = datetime.datetime.now()

    showinfo(title='提示', message='AE分類 操作成功!')

class result_LV_obj:
    def __init__(self):
        self.result_LV = {
            "LV  -∞  ~  0" : 0,
            'LV =0 ~ 20'   : 0,
            'LV =20 ~ 40'  : 0,
            'LV =40 ~ 60'  : 0,
            'LV =60 ~ 80'  : 0,
            'LV =80 ~ 100' : 0,
            'LV =100 ~ 120': 0,
            'LV =120 ~ 140': 0,
            'LV =140 ~ 160': 0,
            'LV =160 ~ 180': 0,
        }

def analyse_AWB(exifpath,result_CCT):
    with open(exifpath + "\SearchResult.exif", 'r', encoding='utf-8') as ef:
        lines = ef.readlines()

    cur_file_name = ''
    cur_file_path = ''
    cur_CCT_key = ''
    cur_LV_key = ''
    for line in lines:
        cur_line_is_CCT = 0
        cur_line_is_LV = 0
        if ".jpg" in line:
            cur_file_path = exifpath + '\\'
            cur_file_name = re.findall(r"[\[](.*?)[\]]", line)[0]
            cur_CCT_key = ''
            cur_LV_key = ''
            continue
        elif line != "\n":
            data_name = line.split(":")[0].replace(" ", "")
            data_value = line.split(":")[1].replace(" ", "").replace("\n", "")
            if data_name == 'AWB_TAG_CCT':
                cur_line_is_CCT = 1
            elif data_name == 'AWB_TAG_ALGO_SCENE_LV':
                cur_line_is_LV = 1
            else:
                continue
        if cur_line_is_CCT == 1:
            cur_CCT = int(data_value)
            if cur_CCT < 2300:
                cur_CCT_key = 'CCT  -∞  ~  2300'
            elif cur_CCT < 2850:
                cur_CCT_key = 'CCT =2300 ~ 2850'
            elif cur_CCT < 3750:
                cur_CCT_key = 'CCT =2850 ~ 3750'
            elif cur_CCT < 5100:
                cur_CCT_key = 'CCT =3750 ~ 5100'
            elif cur_CCT < 6500:
                cur_CCT_key = 'CCT =5100 ~ 6500'
            else:
                cur_CCT_key = 'CCT =6500 ~   ∞'
            if cur_LV_key != '':
                if not os.path.exists(cur_file_path+ cur_CCT_key + "/" + cur_LV_key):
                    if not os.path.exists(cur_file_path+ cur_CCT_key):
                        os.mkdir(cur_file_path+ cur_CCT_key )
                    os.mkdir(cur_file_path + cur_CCT_key + "/" + cur_LV_key)
                result_CCT[cur_CCT_key].result_LV[cur_LV_key] += 1
                src_path = cur_file_path + cur_file_name
                dst_path = cur_file_path + cur_CCT_key + "\\" + cur_LV_key +"\\"+cur_file_name
                with open(src_path, 'rb') as f_src:
                    data = f_src.read()
                    with open(dst_path, 'wb') as f_dst:
                        f_dst.write(data)
                        f_dst.close()
                    f_src.close()
                cur_CCT_key = ''
                cur_LV_key = ''
                cur_file_name = ''
        elif  cur_line_is_LV == 1:
            cur_LV = int(data_value)
            if cur_LV < 0:
                cur_LV_key = 'LV  -∞  ~  0'
            elif cur_LV < 20:
                cur_LV_key = 'LV =0 ~ 20'
            elif cur_LV < 40:
                cur_LV_key = 'LV =20 ~ 40'
            elif cur_LV < 60:
                cur_LV_key = 'LV =40 ~ 60'
            elif cur_LV < 80:
                cur_LV_key = 'LV =60 ~ 80'
            elif cur_LV < 100:
                cur_LV_key = 'LV =80 ~ 100'
            elif cur_LV < 120:
                cur_LV_key = 'LV =100 ~ 120'
            elif cur_LV < 140:
                cur_LV_key = 'LV =120 ~ 140'
            elif cur_LV < 160:
                cur_LV_key = 'LV =140 ~ 160'
            elif cur_LV < 180:
                cur_LV_key = 'LV =160 ~ 180'


def run_AWB():
    result_LV_0 = result_LV_obj()
    result_LV_1 = result_LV_obj()
    result_LV_2 = result_LV_obj()
    result_LV_3 = result_LV_obj()
    result_LV_4 = result_LV_obj()
    result_LV_5 = result_LV_obj()
    result_CCT = {
        "CCT  -∞  ~  2300": result_LV_0,
        "CCT =2300 ~ 2850": result_LV_1,
        "CCT =2850 ~ 3750": result_LV_2,
        "CCT =3750 ~ 5100": result_LV_3,
        "CCT =5100 ~ 6500": result_LV_4,
        "CCT =6500 ~   ∞": result_LV_5,
    }
    global photopath
    for cct_key in result_CCT:
        dir_name = photopath + "\\" + cct_key
        if os.path.isdir(dir_name):
            shutil.rmtree(dir_name)
    result_AE=["Face","Normal"]
    for cct_key in result_AE:
        dir_name = photopath + "\\" + cct_key
        if os.path.isdir(dir_name):
            shutil.rmtree(dir_name)
    child1_AWB = subprocess.Popen(
        f"{debug_Tool} -dump {photopath} -find \"AWB_TAG_CCT|AWB_TAG_ALGO_SCENE_LV\" -save {photopath}/")
    child1_AWB.wait()

    analyse_AWB(photopath,result_CCT)
    for cct_key in result_CCT:
        for lv_key in result_CCT[cct_key].result_LV:
            lv_count = result_CCT[cct_key].result_LV[lv_key]
            if os.path.exists(photopath+'\\'+ cct_key +'\\'+ lv_key) == False:
                if os.path.exists(photopath+'\\'+ cct_key) == False:
                    os.mkdir(photopath + '\\' + cct_key )
                os.mkdir(photopath+'\\'+ cct_key +'\\'+ lv_key)
            os.rename(photopath+'\\'+ cct_key +'\\'+ lv_key,
                    photopath+'\\'+ cct_key +'\\'+ '_'+str(lv_count)+'_'+lv_key)
    showinfo(title='提示', message='AWB分類 操作成功!')

# 初始化布局
root = tk.Tk()
root.title("AE_AWB圖片分類小工具")

img_use_pic = open(r'C:PCBico.png', 'wb')  # 創(chuàng)建臨時(shí)使用圖片文件,這里放在了C盤的temp文件夾里
img_use_pic.write(base64.b64decode(img_pic))
img_use_pic.close()
image = tk.PhotoImage(file='C:PCBico.png')
root.iconphoto(False,image)
root.wm_iconphoto(False,image)
max_w, max_h = root.maxsize()
root.geometry(f'500x300+{int((max_w - 500) / 2)}+{int((max_h - 300) / 2)}')  # 居中
root.resizable(width=False, height=False)

# 初始化Entry控件
debug_entry = tk.StringVar()  # 選擇目錄信息
photo_entry = tk.StringVar()  # 輸出路徑信息

if os.path.exists(os.getcwd() + "\default_path.txt"):
    with open(os.getcwd() + "\default_path.txt", 'r') as f_default_path:
        lines = f_default_path.readlines()
        print(lines)
        for line in lines:
            if line.startswith("tool_deault_dir=") :
                default_tool_dir = line.split("tool_deault_dir=")[1].replace("\n", "")
                print(default_tool_dir)
                print(default_tool_dir)
                if "DebugParser.exe" in default_tool_dir:
                    debug_entry.set(default_tool_dir)
                    debug_Tool = default_tool_dir
            if line.startswith("photo_deault_dir=") :
                default_photo_dir = line.split("photo_deault_dir=")[1].replace("\n", "")
                if os.path.isdir(default_photo_dir):
                    photo_entry.set(default_photo_dir)
                    photopath = default_photo_dir


# === 布局控件
# raw路徑 label
label = tk.Label(root, text="DP路徑", font=("", 15))
label.place(x=50, y=80)

# 輸入路徑
raw_path = tk.Entry(root, textvariable=debug_entry, font=('', 15), width=20)
raw_path.place(x=130, y=80)

# 選擇文件夾 按鈕
button_raw = tk.Button(root, text="選擇文件", command=select_tool_dir, font=('', 10), width=15)
button_raw.place(x=350, y=80)

# out路徑 label
label2 = tk.Label(root, text="Pic路徑", font=("", 15))
label2.place(x=50, y=160)

# out信息框
out_path = tk.Entry(root, textvariable=photo_entry, font=('', 15), width=20)
out_path.place(x=130, y=160)

button_raw = tk.Button(root, text="選擇文件夾", command=select_picture_path, font=('', 10), width=15)
button_raw.place(x=350, y=160)


button_raw = tk.Button(root, text="運(yùn)行AE分類", command=run_AE, font=('', 10), width=15)
button_raw.place(x=80, y=220)

button_raw = tk.Button(root, text="運(yùn)行AWB分類", command=run_AWB, font=('', 10), width=15)
button_raw.place(x=240, y=220)
root.mainloop()
os.remove(r'C:PCBico.png')

要點(diǎn)1:Popen 調(diào)用windows工具,命令行可執(zhí)行的命令

 subprocess.Popen(
        f"{debug_Tool} -dump {photopath} -find \"AWB_TAG_CCT|AWB_TAG_ALGO_SCENE_LV\" -save {photopath}/")

要點(diǎn)2:將圖片文件轉(zhuǎn)換為 py 文件,從代碼中調(diào)用,方便打包

from png_resource import img as img_pic

root = tk.Tk()
img_use_pic = open(r'C:PCBico.png', 'wb')  # 創(chuàng)建臨時(shí)使用圖片文件,這里放在了C盤的temp文件夾里
img_use_pic.write(base64.b64decode(img_pic))
img_use_pic.close()
image = tk.PhotoImage(file='C:PCBico.png')
root.iconphoto(False,image)
root.wm_iconphoto(False,image)


os.remove(r'C:PCBico.png')  #結(jié)束時(shí)調(diào)用

要點(diǎn)3:python 用class 模擬C 語(yǔ)音的結(jié)構(gòu)體,字典嵌套實(shí)現(xiàn)如下,可以都放入class 內(nèi)部簡(jiǎn)化代碼

class result_LV_obj:
    def __init__(self):
        self.result_LV = {
            "LV  -∞  ~  0" : 0,
            'LV =0 ~ 20'   : 0,
            'LV =20 ~ 40'  : 0,
            'LV =40 ~ 60'  : 0,
            'LV =60 ~ 80'  : 0,
            'LV =80 ~ 100' : 0,
            'LV =100 ~ 120': 0,
            'LV =120 ~ 140': 0,
            'LV =140 ~ 160': 0,
            'LV =160 ~ 180': 0,
        }
def run_AWB():
    result_LV_0 = result_LV_obj()
    result_LV_1 = result_LV_obj()
    result_LV_2 = result_LV_obj()
    result_LV_3 = result_LV_obj()
    result_LV_4 = result_LV_obj()
    result_LV_5 = result_LV_obj()
    result_CCT = {
        "CCT  -∞  ~  2300": result_LV_0,
        "CCT =2300 ~ 2850": result_LV_1,
        "CCT =2850 ~ 3750": result_LV_2,
        "CCT =3750 ~ 5100": result_LV_3,
        "CCT =5100 ~ 6500": result_LV_4,
        "CCT =6500 ~   ∞": result_LV_5,
    }

未解決問(wèn)題:

? ? ? ? ?1. 原本采用 遞歸 遍歷文件夾 的方式,每完成對(duì)當(dāng)前文件的分類時(shí)直接修改目標(biāo)文件夾名稱;總是會(huì)提示文件夾仍然被占用錯(cuò)誤。

? ? ? ? ?2. 后嘗試遞歸函數(shù)放入單獨(dú)的線程中執(zhí)行,子線程遍歷過(guò)程中維護(hù)2個(gè)列表,分別保存需要修改的文件名完整路徑 和 重命名后的文件名完整路徑,并在這個(gè)子線程結(jié)束調(diào)用后再遍歷列表,對(duì)文件夾進(jìn)行重命名,仍然有相同文件仍然被占用錯(cuò)誤。主線程中在子線程結(jié)束后仍然加2秒延時(shí),還是會(huì)有這個(gè)錯(cuò)誤。。

? ? ? ? 3. 嘗試列表中直接寫死直接對(duì)文件夾調(diào)用重命名,可以成功。。。未知文件被占用的根本原因。

? ? ? ? 4. 文件被占用查詢占用情況詳細(xì)信息方法未嘗試成功,待繼續(xù)分析。文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-610062.html

到了這里,關(guān)于Python tkinker 界面設(shè)計(jì)與圖標(biāo)設(shè)置和圖片文件打包成單個(gè)exe的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • python美化圖形化界面設(shè)計(jì),pythontkinter界面美化

    python美化圖形化界面設(shè)計(jì),pythontkinter界面美化

    大家好,本文將圍繞python美化圖形化界面設(shè)計(jì)展開(kāi)說(shuō)明,pythontkinter界面美化是一個(gè)很多人都想弄明白的事情,想搞清楚python美化輸出模塊需要先了解以下幾個(gè)事情。 PyQt,一個(gè)基于Qt的Python接口包,可以直接使用Qt的控件薯轎茄,還可以使用QSS進(jìn)行界面美化,下面我簡(jiǎn)單介紹一

    2024年02月08日
    瀏覽(27)
  • Python編程:Tkinter圖形界面設(shè)計(jì)(1)

    Python編程:Tkinter圖形界面設(shè)計(jì)(1)

    目錄 一、Tkinter的程序框架 ?二、窗口內(nèi)容 2.1 窗口的幾何尺寸 2.2 窗口的擺放位置 2.3? 實(shí)驗(yàn)代碼 2.4 控件管理 三、控件編程 窗口的生成和窗口的呈現(xiàn),用Tk()和mainloop()包括起來(lái),中間程序是附著在窗口的內(nèi)部部件。 ? 窗口的內(nèi)容,是最豐富的細(xì)節(jié)包括:1、幾何尺寸 2、按鈕

    2024年02月07日
    瀏覽(28)
  • Python | 人臉識(shí)別系統(tǒng) — UI界面設(shè)計(jì)

    Python | 人臉識(shí)別系統(tǒng) — UI界面設(shè)計(jì)

    博客匯總:Python | 人臉識(shí)別系統(tǒng) — 博客索引 GitHub地址:Su-Face-Recognition 注:閱讀本博客前請(qǐng)先參考 工具安裝、環(huán)境配置:Python | 人臉識(shí)別系統(tǒng) — 簡(jiǎn)介 ? ? ? ? 本項(xiàng)目采用PyQt庫(kù)作為UI界面的編寫,使用Qt-Designer、PyUIC自動(dòng)生成UI界面代碼。 關(guān)于PyQt庫(kù)的詳細(xì)使用可以參考該系

    2024年02月12日
    瀏覽(56)
  • Python QT5設(shè)計(jì)UI界面教程

    Python QT5設(shè)計(jì)UI界面教程

    簡(jiǎn)介:PyQT5開(kāi)發(fā)常用知識(shí),零基礎(chǔ)上手,需配合我之前寫的博文,配置好QT設(shè)計(jì)工具和ui文件轉(zhuǎn)py文件的工具。博文為:使用Python PyQt5實(shí)現(xiàn)一個(gè)簡(jiǎn)單的圖像識(shí)別軟件;頁(yè)面效果如下: 1.設(shè)計(jì)菜單欄 Containers——Tab Widget; 2.橫向排布? 可以自動(dòng)水平對(duì)齊 3.文本框和選擇框 4.日期輸入

    2024年01月17日
    瀏覽(51)
  • 【Python入門系列】第八篇:Python中GUI編程和圖形界面設(shè)計(jì)

    Python中的GUI編程是指使用Python語(yǔ)言創(chuàng)建圖形用戶界面(GUI)的過(guò)程。通過(guò)GUI,用戶可以與程序進(jìn)行交互,通過(guò)按鈕、菜單、文本框等控件來(lái)操作程序。 Python提供了多個(gè)庫(kù)和框架來(lái)實(shí)現(xiàn)GUI編程,其中最常用的是Tkinter、wxPython、PyQt和PyGTK等。這些庫(kù)提供了豐富的控件和功能,使開(kāi)

    2024年02月07日
    瀏覽(20)
  • Python學(xué)習(xí)筆記--exe文件打包與UI界面設(shè)計(jì)

    Python學(xué)習(xí)筆記--exe文件打包與UI界面設(shè)計(jì)

    又是半年時(shí)間過(guò)去了,終于有有時(shí)間摸魚學(xué)一點(diǎn)python了。本次練習(xí)主要針對(duì)之前寫過(guò)的自動(dòng)打卡腳本,將其打包成exe文件,并加上UI界面。其實(shí)對(duì)于自動(dòng)打卡這個(gè)功能來(lái)說(shuō),UI界面并不是必需品,加上了界面反而有些麻煩。 我比較熟悉的UI相關(guān)的庫(kù)主要有 easygui,tkinter,pyqt5

    2024年02月05日
    瀏覽(26)
  • 數(shù)據(jù)庫(kù)課程設(shè)計(jì) python+mysql+圖形化界面

    數(shù)據(jù)庫(kù)課程設(shè)計(jì) python+mysql+圖形化界面

    進(jìn)行操作的表 ? 增加界面 ? 刪除界面 ? 修改界面 ? ?查找界面 ?

    2024年02月09日
    瀏覽(18)
  • Python圖形用戶界面設(shè)計(jì)-Delphi For Python高級(jí)開(kāi)發(fā)教程

    Python圖形用戶界面設(shè)計(jì)-Delphi For Python高級(jí)開(kāi)發(fā)教程

    目錄 簡(jiǎn)介........................................................................ 5 誰(shuí)應(yīng)該閱讀這本教程........................................................ 5 第1章 Python與Delphi...................................................... 6 什么是Delphi4Python....................................................... 6 1.1 Python語(yǔ)言介紹....

    2024年02月07日
    瀏覽(62)
  • 人臉識(shí)別系統(tǒng)OpenCV+dlib+python(含數(shù)據(jù)庫(kù))Pyqt5界面設(shè)計(jì) 項(xiàng)目源碼 畢業(yè)設(shè)計(jì)

    人臉識(shí)別系統(tǒng)OpenCV+dlib+python(含數(shù)據(jù)庫(kù))Pyqt5界面設(shè)計(jì) 項(xiàng)目源碼 畢業(yè)設(shè)計(jì)

    Python語(yǔ)言、dlib、OpenCV、Pyqt5界面設(shè)計(jì)、sqlite3數(shù)據(jù)庫(kù) ? ? ?本系統(tǒng)使用dlib作為人臉識(shí)別工具,dlib提供一個(gè)方法可將人臉圖片數(shù)據(jù)映射到128維度的空間向量,如果兩張圖片來(lái)源于同一個(gè)人,那么兩個(gè)圖片所映射的空間向量距離就很近,否則就會(huì)很遠(yuǎn)。因此,可以通過(guò)提取圖片并

    2024年02月05日
    瀏覽(20)
  • Python 使用tkinter設(shè)計(jì)Windows網(wǎng)頁(yè)或應(yīng)用的用戶注冊(cè)登錄界面

    Python 使用tkinter設(shè)計(jì)Windows網(wǎng)頁(yè)或應(yīng)用的用戶注冊(cè)登錄界面

    上一篇:Python 自定義模塊和包設(shè)計(jì)英語(yǔ)生詞本(文件版)-CSDN博客 緊接上一篇博文,當(dāng)我們熟練掌握自定義模塊和包、掌握文件的的讀取與寫入、掌握正則表達(dá)式內(nèi)置模塊\\\"re\\\"、掌握GUI(圖形界面)的部分組件后,接著我們將要以上的知識(shí)點(diǎn)結(jié)合起來(lái),設(shè)計(jì)一個(gè)GUI(圖形界面

    2024年02月03日
    瀏覽(18)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包