<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>ITHOME</title><link>https://knature.top/</link><description>Hello, Guys! It's Me</description><item><title>VPN tiktok</title><link>https://knature.top/?id=128</link><description>&lt;p&gt;Set zone to VPN&lt;br/&gt;&lt;/p&gt;&lt;p&gt;whoer check IP&lt;/p&gt;&lt;p&gt;Auto Scroll&amp;nbsp; #extension&lt;/p&gt;&lt;p&gt;Instant Data Scraper&amp;nbsp; #extension&lt;/p&gt;&lt;p&gt;Email and What&amp;#39;s app extractor&amp;nbsp; #extension&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Kiwi browser&lt;/p&gt;&lt;p&gt;Colab&lt;/p&gt;</description><pubDate>Fri, 28 Jun 2024 15:31:56 +0800</pubDate></item><item><title>MP4 MD5 Modifier</title><link>https://knature.top/?id=127</link><description>&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import tkinter as tk&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;from tkinter import filedialog, messagebox&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import os&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import hashlib&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import random&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import shutil&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def calculate_md5(file_path):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; hash_md5 = hashlib.md5()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; with open(file_path, &amp;quot;rb&amp;quot;) as f:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for chunk in iter(lambda: f.read(4096), b&amp;quot;&amp;quot;):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hash_md5.update(chunk)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; return hash_md5.hexdigest()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def modify_mp4(file_path):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; with open(file_path, &amp;quot;ab&amp;quot;) as f:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; f.write(os.urandom(random.randint(100, 1000)))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def process_files(input_folder, output_folder, text_output):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if not input_folder or not output_folder:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showerror(&amp;quot;错误&amp;quot;, &amp;quot;请选择输入及输出路径！&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if not os.path.exists(output_folder):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; os.makedirs(output_folder)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; text_output.delete(&amp;#39;1.0&amp;#39;, tk.END)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; for file_name in os.listdir(input_folder):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if file_name.endswith(&amp;quot;.mp4&amp;quot;):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; input_file_path = os.path.join(input_folder, file_name)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output_file_path = os.path.join(output_folder, file_name)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; original_md5 = calculate_md5(input_file_path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; modify_mp4(input_file_path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; modified_md5 = calculate_md5(input_file_path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; shutil.copyfile(input_file_path, output_file_path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_output.insert(tk.END, f&amp;quot;文件名称: {file_name}\n&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_output.insert(tk.END, f&amp;quot;原本的MD5: {original_md5}\n&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_output.insert(tk.END, f&amp;quot;修改后的MD5: {modified_md5}\n&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_output.insert(tk.END, f&amp;quot;储存路径: {output_file_path}\n\n&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; messagebox.showinfo(&amp;quot;操作完成&amp;quot;, &amp;quot;所有视频文件的MD5已被修改完毕！&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root = tk.Tk()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root.title(&amp;quot;MP4视频MD5_Calculator&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;input_folder = &amp;quot;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;output_folder = &amp;quot;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def open_folder():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global input_folder&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; input_folder = filedialog.askdirectory(title=&amp;quot;选择放有视频的文件夹&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; input_folder_label.config(text=input_folder)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def select_output_folder():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global output_folder&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; output_folder = filedialog.askdirectory(title=&amp;quot;选择输出视频的文件夹&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; output_folder_label.config(text=output_folder)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;input_folder_btn = tk.Button(root, text=&amp;quot;打开放有视频的文件夹&amp;quot;, command=open_folder)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;input_folder_btn.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;input_folder_label = tk.Label(root, text=&amp;quot;Input Folder: &amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;input_folder_label.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;output_folder_btn = tk.Button(root, text=&amp;quot;选择输出视频的文件夹&amp;quot;, command=select_output_folder)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;output_folder_btn.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;output_folder_label = tk.Label(root, text=&amp;quot;Output Folder: &amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;output_folder_label.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;text_output = tk.Text(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;text_output.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;process_btn = tk.Button(root, text=&amp;quot;更改MP4视频文件MD5&amp;quot;, command=lambda: process_files(input_folder, output_folder, text_output))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;process_btn.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root.mainloop()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 21 Feb 2024 18:45:01 +0800</pubDate></item><item><title>tkinter menu creation</title><link>https://knature.top/?id=126</link><description>&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import tkinter as tk&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;win7_window = None&amp;nbsp; # 用于保存 Win7 窗口的引用&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;win10_window = None&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;win11_window = None&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;win12_window = None&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def show_selected_key():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; text_box.delete(1.0, tk.END)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; text_box.insert(tk.END, &amp;#39;win7 key: 123456&amp;#39;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def close_win7_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win7_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win7_window.destroy()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win7_window = None&amp;nbsp; # 当 Win7 窗口关闭时，重置窗口变量&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def close_win10_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win10_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win10_window.destroy()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win10_window = None&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def close_win11_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win11_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win11_window.destroy()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win11_window = None&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def close_win12_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win12_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win12_window.destroy()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win12_window = None&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def show_win7_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win7_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if win7_window is None:&amp;nbsp; # 如果 Win7 窗口尚未打开&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win7_window = tk.Toplevel(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win7_window.geometry(&amp;quot;720x180&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win7_window.title(&amp;quot;Keygen&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win7_window.resizable(False, False)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; global text_box&amp;nbsp; &amp;nbsp;# 在函数内部使用全局的 text_box 变量&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_box = tk.Text(win7_window, height=10, width=50)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_box.place(relx=0.5, rely=0.5, anchor=&amp;quot;center&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button = tk.Button(win7_window, text=&amp;quot;Show Key&amp;quot;, command=show_selected_key)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button.place(relx=0.175, rely=0.5, anchor=&amp;quot;center&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win7_window.protocol(&amp;quot;WM_DELETE_WINDOW&amp;quot;, close_win7_window)&amp;nbsp; # 监听窗口关闭事件&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def show_win10_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win10_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if win10_window is None:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win10_window = tk.Toplevel(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; key_label = tk.Label(win10_window, text=&amp;quot;Win10 Key: 678910&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; key_label.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win10_window.protocol(&amp;quot;WM_DELETE_WINDOW&amp;quot;, close_win10_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def show_win11_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win11_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if win11_window is None:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win11_window = tk.Toplevel(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; key_label = tk.Label(win11_window, text=&amp;quot;Win11 Key: 12345&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; key_label.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win11_window.protocol(&amp;quot;WM_DELETE_WINDOW&amp;quot;, close_win11_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def show_win12_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win12_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if win12_window is None:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win12_window = tk.Toplevel(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; key_label = tk.Label(win12_window, text=&amp;quot;Win12 Key: 678910&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; key_label.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win12_window.protocol(&amp;quot;WM_DELETE_WINDOW&amp;quot;, close_win12_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root = tk.Tk()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;menubar = tk.Menu(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;filemenu = tk.Menu(menubar, tearoff=0, activebackground=&amp;#39;red&amp;#39;, activeforeground=&amp;#39;yellow&amp;#39;,bg=&amp;#39;light green&amp;#39;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;filemenu.add_command(label=&amp;quot;Win7&amp;quot;, command=show_win7_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;filemenu.add_command(label=&amp;quot;Win10&amp;quot;, command=show_win10_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;othermenu = tk.Menu(menubar, tearoff=0, activebackground=&amp;#39;red&amp;#39;, activeforeground=&amp;#39;yellow&amp;#39;,bg=&amp;#39;light green&amp;#39;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;othermenu.add_command(label=&amp;quot;Win11&amp;quot;, command=show_win11_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;othermenu.add_command(label=&amp;quot;Win12&amp;quot;, command=show_win12_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;menubar.add_cascade(label=&amp;quot;Open&amp;quot;, menu=filemenu)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;menubar.add_cascade(label=&amp;quot;Other&amp;quot;, menu=othermenu)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;menubar.add_command(label=&amp;quot;Close&amp;quot;, command=root.destroy)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root.config(menu=menubar)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root.mainloop()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Sat, 27 Jan 2024 18:44:11 +0800</pubDate></item><item><title>tk moviepy</title><link>https://knature.top/?id=125</link><description>&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import tkinter as tk&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import cv2&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import os&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;from tkinter import filedialog, messagebox, Label, Entry, Button&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;from moviepy.editor import VideoFileClip&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def open_file():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; file_path = filedialog.askopenfilename(filetypes=[(&amp;quot;Video Files&amp;quot;, &amp;quot;*.mp4&amp;quot;)])&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if file_path:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry_file_path.delete(0, tk.END)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry_file_path.insert(tk.END, file_path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def split_video():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; file_path = entry_file_path.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; start_time = entry_start_time.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; end_time = entry_end_time.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; output_folder = &amp;quot;output&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if not os.path.exists(output_folder):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; os.makedirs(output_folder)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if file_path and start_time and end_time:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clip = VideoFileClip(file_path).subclip(start_time, end_time)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output_path = f&amp;quot;{output_folder}/output.mp4&amp;quot;&amp;nbsp; # 设置输出文件路径&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clip.write_videofile(output_path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #lbl_status.config(text=&amp;quot;分割完成！&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showinfo(&amp;quot;Info&amp;quot;, &amp;quot;分割完成！&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; except Exception as e:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #lbl_status.config(text=str(e))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showerror(&amp;quot;Error&amp;quot;, text=str(e))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; else:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #lbl_status.config(text=&amp;quot;请填写影片的路径，剪辑开始及结束时间!&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showerror(&amp;quot;Error&amp;quot;, &amp;quot;请填写影片的路径,剪辑开始及结束时间!&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def extract_frames():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; file_path = entry_file_path.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; start_time_str = entry_start_time.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; end_time_str = entry_end_time.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if file_path and start_time_str and end_time_str:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; start_time = sum(int(x) * 60 ** i for i, x in enumerate(reversed(start_time_str.split(&amp;quot;:&amp;quot;))))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end_time = sum(int(x) * 60 ** i for i, x in enumerate(reversed(end_time_str.split(&amp;quot;:&amp;quot;))))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; video_capture = cv2.VideoCapture(file_path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; video_capture.set(cv2.CAP_PROP_FPS, 30)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output_folder = &amp;quot;output&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if not os.path.exists(output_folder):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; os.makedirs(output_folder)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; saved_frame_name = 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while video_capture.isOpened():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; frame_is_read, frame = video_capture.read()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if frame_is_read:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # 保存指定时间范围内的帧&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current_time = video_capture.get(cv2.CAP_PROP_POS_MSEC) / 1000&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if start_time &amp;lt;= current_time &amp;lt;= end_time:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cv2.imwrite(f&amp;quot;{output_folder}/frame{str(saved_frame_name)}.jpg&amp;quot;, frame)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; saved_frame_name += 1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elif current_time &amp;gt; end_time:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&amp;quot;Couldn&amp;#39;t read the frame anymore！&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; video_capture.release()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showinfo(&amp;quot;Info&amp;quot;, &amp;quot;提取帧成功! 已经保存到output文件夹。&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; else:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showerror(&amp;quot;Error&amp;quot;, &amp;quot;请填写正确的影片路径,剪辑开始及结束时间!&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def start_execution():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if choice.get() == 1:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; split_video()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; elif choice.get() == 2:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; extract_frames()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# 创建Tkinter窗口&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root = tk.Tk()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root.geometry(&amp;quot;350x200&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root.title(&amp;quot;MP4视频帧提取及分割工具&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root.resizable(False, False)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# 打开文件按钮&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;btn_open_file = tk.Button(root, text=&amp;quot;打开MP4文件&amp;quot;, command=open_file)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;btn_open_file.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# 文件路径输入框&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;entry_file_path = tk.Entry(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;entry_file_path.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# 开始时间输入框&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;Label(root, text=&amp;quot;开始时间--00:00（秒）&amp;quot;).pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;entry_start_time = Entry(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;entry_start_time.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# 结束时间输入框&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;Label(root, text=&amp;quot;结束时间--00:00（秒）&amp;quot;).pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;entry_end_time = Entry(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;entry_end_time.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# 创建Radio Button的变量&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;choice = tk.IntVar()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# 创建一个 Frame 来放置 radio_button1 和 radio_button2&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;radio_frame = tk.Frame(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;radio_frame.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;radio_button1 = tk.Radiobutton(radio_frame, text=&amp;quot;分割MP4视频&amp;quot;, variable=choice, value=1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;radio_button1.pack(side=&amp;quot;left&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;radio_button2 = tk.Radiobutton(radio_frame, text=&amp;quot;提取MP4视频图片&amp;quot;, variable=choice, value=2)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;radio_button2.pack(side=&amp;quot;left&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;start_button = tk.Button(root, text=&amp;quot;开始执行&amp;quot;, command=start_execution)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;start_button.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# 状态标签&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;lbl_status = tk.Label(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;lbl_status.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# 运行窗口的主循环&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root.mainloop()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Sat, 27 Jan 2024 17:00:44 +0800</pubDate></item><item><title>Movies GUI Tools</title><link>https://knature.top/?id=121</link><description>&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import tkinter as tk&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;from tkinter import filedialog, messagebox, Label, Entry, Button&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import os&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import hashlib&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import random&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import shutil&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import boto3&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import cv2&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;from moviepy.editor import VideoFileClip&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;win7_window = None&amp;nbsp; # 用于保存 Win7 窗口的引用&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;win10_window = None&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;win11_window = None&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;win12_window = None&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;win01_window = None&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def show_selected_key():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; text_box.delete(1.0, tk.END)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; text_box.insert(tk.END, &amp;#39;win7 key: 123456&amp;#39;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;############ login ############&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def check_password():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; password = password_entry.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if password == &amp;quot;18503&amp;quot;:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; menubar.entryconfig(&amp;quot;Open&amp;quot;, state=&amp;quot;normal&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; menubar.entryconfig(&amp;quot;Other&amp;quot;, state=&amp;quot;normal&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; menubar.entryconfig(&amp;quot;Close&amp;quot;, state=&amp;quot;normal&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; password_entry.delete(0, tk.END)&amp;nbsp; # 清空密码输入框&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; password_label.config(state=tk.DISABLED)&amp;nbsp; # 禁用密码标签&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; password_entry.config(state=tk.DISABLED)&amp;nbsp; # 禁用密码输入框&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; confirm_button.config(state=tk.DISABLED)&amp;nbsp; # 禁用确认按钮&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showinfo(&amp;quot;完成!&amp;quot;, &amp;quot;已经解锁所有功能!&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; else:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showerror(&amp;quot;密码错误&amp;quot;, &amp;quot;请输入正确密码！&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;############ text to speech ############&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;aws_access_key_id = &amp;#39;AKIA47CRUYAIT5KL3DXG&amp;#39;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;aws_secret_access_key = &amp;#39;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&amp;#39;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;region_name = &amp;#39;eu-west-1&amp;#39;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;available_voices = {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;quot;Zhiyu-普通话（女）&amp;quot;: &amp;quot;Zhiyu&amp;quot;,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;quot;Hiujin-广东话（女）&amp;quot;: &amp;quot;Hiujin&amp;quot;,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;quot;Joanna-英文-（女）&amp;quot;: &amp;quot;Joanna&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def save_completed_dialog(save_path):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; messagebox.showinfo(&amp;quot;完成!&amp;quot;, f&amp;quot;储存路径:\n{save_path}&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def generate_mp3():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; text = entry.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; polly_client = boto3.client(&amp;#39;polly&amp;#39;, aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key, region_name=region_name)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; response = polly_client.synthesize_speech(&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Text=text,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OutputFormat=&amp;#39;mp3&amp;#39;,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VoiceId=selected_voice.get(),&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Engine=&amp;#39;neural&amp;#39;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; save_path = filedialog.asksaveasfilename(defaultextension=&amp;quot;.mp3&amp;quot;, filetypes=[(&amp;quot;MP3 files&amp;quot;, &amp;quot;*.mp3&amp;quot;)])&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if save_path:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; with open(save_path, &amp;#39;wb&amp;#39;) as file:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file.write(response[&amp;#39;AudioStream&amp;#39;].read())&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&amp;quot;Speech saved as&amp;quot;, save_path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; save_completed_dialog(save_path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;############ text to speech ############&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;############&amp;nbsp; MP4视频帧提取及分割工具 ############&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def open_file():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; file_path = filedialog.askopenfilename(filetypes=[(&amp;quot;Video Files&amp;quot;, &amp;quot;*.mp4&amp;quot;)])&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if file_path:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry_file_path.delete(0, tk.END)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry_file_path.insert(tk.END, file_path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def is_file_path_valid(file_path):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if not file_path.strip():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showerror(&amp;quot;错误&amp;quot;, &amp;quot;请输入正确的文件路径!&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return False&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; return True&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def split_video():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; file_path = entry_file_path.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; start_time = entry_start_time.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; end_time = entry_end_time.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; output_folder = &amp;quot;output&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if not is_file_path_valid(file_path):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if not os.path.exists(output_folder):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; os.makedirs(output_folder)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if file_path and start_time and end_time:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clip = VideoFileClip(file_path).subclip(start_time, end_time)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output_path = f&amp;quot;{output_folder}/output.mp4&amp;quot;&amp;nbsp; # 设置输出文件路径&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clip.write_videofile(output_path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #lbl_status.config(text=&amp;quot;分割完成！&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showinfo(&amp;quot;Info&amp;quot;, &amp;quot;分割完成！&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; except Exception as e:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #lbl_status.config(text=str(e))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showerror(&amp;quot;错误&amp;quot;, text=str(e))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; else:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #lbl_status.config(text=&amp;quot;请填写影片的路径，剪辑开始及结束时间!&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showerror(&amp;quot;错误&amp;quot;, &amp;quot;请输入正确的影片路径,剪辑开始及结束时间!&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def extract_frames():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; file_path = entry_file_path.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; start_time_str = entry_start_time.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; end_time_str = entry_end_time.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if not is_file_path_valid(file_path):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if file_path and start_time_str and end_time_str:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; start_time = sum(int(x) * 60 ** i for i, x in enumerate(reversed(start_time_str.split(&amp;quot;:&amp;quot;))))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end_time = sum(int(x) * 60 ** i for i, x in enumerate(reversed(end_time_str.split(&amp;quot;:&amp;quot;))))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; video_capture = cv2.VideoCapture(file_path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; video_capture.set(cv2.CAP_PROP_FPS, 30)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output_folder = &amp;quot;output&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if not os.path.exists(output_folder):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; os.makedirs(output_folder)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; saved_frame_name = 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while video_capture.isOpened():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; frame_is_read, frame = video_capture.read()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if frame_is_read:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # 保存指定时间范围内的帧&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current_time = video_capture.get(cv2.CAP_PROP_POS_MSEC) / 1000&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if start_time &amp;lt;= current_time &amp;lt;= end_time:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cv2.imwrite(f&amp;quot;{output_folder}/frame{str(saved_frame_name)}.jpg&amp;quot;, frame)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; saved_frame_name += 1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elif current_time &amp;gt; end_time:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&amp;quot;Couldn&amp;#39;t read the frame anymore！&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; video_capture.release()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showinfo(&amp;quot;Info&amp;quot;, &amp;quot;提取帧成功! 已经保存到output文件夹。&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; else:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showerror(&amp;quot;错误&amp;quot;, &amp;quot;请输入正确的影片路径,剪辑开始及结束时间!&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def start_execution():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if choice.get() == 1:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; split_video()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; elif choice.get() == 2:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; extract_frames()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; else:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showerror(&amp;quot;错误&amp;quot;, &amp;quot;请输入需要打开的文件路径，开始及结束时间，选择对应的操作！&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;############&amp;nbsp; MP4视频帧提取及分割工具 ############&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;############ MD5 Modifier ############&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def calculate_md5(file_path):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; hash_md5 = hashlib.md5()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; with open(file_path, &amp;quot;rb&amp;quot;) as f:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for chunk in iter(lambda: f.read(4096), b&amp;quot;&amp;quot;):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hash_md5.update(chunk)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; return hash_md5.hexdigest()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def modify_mp4(file_path):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; with open(file_path, &amp;quot;ab&amp;quot;) as f:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; f.write(os.urandom(random.randint(100, 1000)))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def process_files(input_folder, output_folder, text_output):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if not input_folder or not output_folder:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showerror(&amp;quot;错误&amp;quot;, &amp;quot;请选择输入及输出文件夹的路径！&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if input_folder == output_folder:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showerror(&amp;quot;错误&amp;quot;, &amp;quot;输入的文件夹路径不能与来源相同！&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if not output_folder:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showerror(&amp;quot;错误&amp;quot;, &amp;quot;请选择输出视频的文件夹路径！&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; mp4_files = [f for f in os.listdir(input_folder) if f.endswith(&amp;quot;.mp4&amp;quot;)]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if not mp4_files:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showinfo(&amp;quot;提示&amp;quot;, &amp;quot;输入文件夹中没有找到 *.mp4 档案可以处理！&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if not os.path.exists(output_folder):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; os.makedirs(output_folder)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; text_output.delete(&amp;#39;1.0&amp;#39;, tk.END)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; for file_name in os.listdir(input_folder):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if file_name.endswith(&amp;quot;.mp4&amp;quot;):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; input_file_path = os.path.join(input_folder, file_name)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output_file_path = os.path.join(output_folder, file_name)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; original_md5 = calculate_md5(input_file_path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; modify_mp4(input_file_path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; modified_md5 = calculate_md5(input_file_path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; shutil.copyfile(input_file_path, output_file_path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_output.insert(tk.END, f&amp;quot;文件名称: {file_name}\n&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_output.insert(tk.END, f&amp;quot;原本的MD5: {original_md5}\n&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_output.insert(tk.END, f&amp;quot;修改后的MD5: {modified_md5}\n&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_output.insert(tk.END, f&amp;quot;储存路径: {output_file_path}\n\n&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; messagebox.showinfo(&amp;quot;操作完成&amp;quot;, &amp;quot;所有视频文件的MD5已被修改完毕！&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;input_folder = &amp;quot;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;output_folder = &amp;quot;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def open_folder():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global input_folder&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; input_folder = filedialog.askdirectory(parent=root, title=&amp;quot;选择放有视频的文件夹&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; input_folder_label.config(text=input_folder)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def select_output_folder():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global output_folder&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; output_folder = filedialog.askdirectory(parent=root, title=&amp;quot;选择输出视频的文件夹&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; output_folder_label.config(text=output_folder)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;############ MD5 Modifier ############&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def close_win7_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win7_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win7_window.destroy()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win7_window = None&amp;nbsp; # 当 Win7 窗口关闭时，重置窗口变量&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def close_win10_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win10_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win10_window.destroy()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win10_window = None&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def close_win11_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win11_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win11_window.destroy()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win11_window = None&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def close_win12_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win12_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win12_window.destroy()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win12_window = None&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def close_win01_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win01_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win01_window.destroy()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; win01_window = None&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def show_win7_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win7_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if win7_window is None:&amp;nbsp; # 如果 Win7 窗口尚未打开&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win7_window = tk.Toplevel(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win7_window.geometry(&amp;quot;720x180&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win7_window.title(&amp;quot;Keygen&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win7_window.resizable(False, False)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; global text_box&amp;nbsp; &amp;nbsp;# 在函数内部使用全局的 text_box 变量&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_box = tk.Text(win7_window, height=10, width=50)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_box.place(relx=0.5, rely=0.5, anchor=&amp;quot;center&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button = tk.Button(win7_window, text=&amp;quot;Show Key&amp;quot;, command=show_selected_key)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button.place(relx=0.175, rely=0.5, anchor=&amp;quot;center&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win7_window.protocol(&amp;quot;WM_DELETE_WINDOW&amp;quot;, close_win7_window)&amp;nbsp; # 监听窗口关闭事件&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def show_win10_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win10_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if win10_window is None:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win10_window = tk.Toplevel(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win10_window.geometry(&amp;quot;600x460&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win10_window.title(&amp;quot;张燕的MP4视频MD5修改器&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win10_window.resizable(False, False)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; input_folder_btn = tk.Button(win10_window, text=&amp;quot;打开放有视频的文件夹&amp;quot;, command=open_folder)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; input_folder_btn.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; global input_folder_label&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; input_folder_label = tk.Label(win10_window, text=&amp;quot;Input Folder: &amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; input_folder_label.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output_folder_btn = tk.Button(win10_window, text=&amp;quot;选择输出视频的文件夹&amp;quot;, command=select_output_folder)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output_folder_btn.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; global output_folder_label&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output_folder_label = tk.Label(win10_window, text=&amp;quot;Output Folder: &amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output_folder_label.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_output = tk.Text(win10_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_output.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; process_btn = tk.Button(win10_window, text=&amp;quot;更改MP4视频文件MD5&amp;quot;,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; command=lambda: process_files(input_folder, output_folder, text_output))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; process_btn.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win10_window.protocol(&amp;quot;WM_DELETE_WINDOW&amp;quot;, close_win10_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win10_window.mainloop()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def show_win11_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win11_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if win11_window is None:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win11_window = tk.Toplevel(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win11_window.geometry(&amp;quot;500x150&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win11_window.title(&amp;quot;《张燕的AI自然朗读机》&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win11_window.resizable(False, False)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; label = tk.Label(win11_window, text=&amp;quot;请输入需要朗读的文本&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; label.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; global entry&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry = tk.Entry(win11_window, width=50)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; global selected_voice&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; selected_voice = tk.StringVar(value=&amp;quot;Zhiyu&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for voice_name in available_voices:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tk.Radiobutton(win11_window, text=voice_name, variable=selected_voice, value=available_voices[voice_name]).pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button = tk.Button(win11_window, text=&amp;quot;生成 *.MP3&amp;quot;, command=generate_mp3)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win11_window.protocol(&amp;quot;WM_DELETE_WINDOW&amp;quot;, close_win11_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win11_window.mainloop()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def show_win12_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win12_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if win12_window is None:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win12_window = tk.Toplevel(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win12_window.geometry(&amp;quot;350x200&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win12_window.title(&amp;quot;《张燕的MP4视频帧提取及分割工具》&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win12_window.resizable(False, False)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # 打开文件按钮&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; btn_open_file = tk.Button(win12_window, text=&amp;quot;打开MP4文件&amp;quot;, command=open_file)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; btn_open_file.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # 文件路径输入框&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; global entry_file_path&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry_file_path = tk.Entry(win12_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry_file_path.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # 开始时间输入框&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Label(win12_window, text=&amp;quot;开始时间（秒）&amp;quot;).pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; global entry_start_time&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry_start_time = Entry(win12_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry_start_time.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # 结束时间输入框&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Label(win12_window, text=&amp;quot;结束时间（秒）&amp;quot;).pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; global entry_end_time&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry_end_time = Entry(win12_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry_end_time.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # 创建Radio Button的变量&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; global choice&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; choice = tk.IntVar()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # 创建一个 Frame 来放置 radio_button1 和 radio_button2&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; radio_frame = tk.Frame(win12_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; radio_frame.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; radio_button1 = tk.Radiobutton(radio_frame, text=&amp;quot;分割MP4视频&amp;quot;, variable=choice, value=1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; radio_button1.pack(side=&amp;quot;left&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; radio_button2 = tk.Radiobutton(radio_frame, text=&amp;quot;提取MP4视频图片&amp;quot;, variable=choice, value=2)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; radio_button2.pack(side=&amp;quot;left&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; start_button = tk.Button(win12_window, text=&amp;quot;开始执行&amp;quot;, command=start_execution)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; start_button.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # 状态标签&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lbl_status = tk.Label(win12_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lbl_status.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win12_window.protocol(&amp;quot;WM_DELETE_WINDOW&amp;quot;, close_win12_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win12_window.mainloop()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def show_win01_window():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; global win01_window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if win01_window is None:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win01_window = tk.Toplevel(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; key_label = tk.Label(win01_window, text=&amp;quot;Win01 Key: ttttyyyy678910&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; key_label.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win01_window.protocol(&amp;quot;WM_DELETE_WINDOW&amp;quot;, close_win01_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win01_window.mainloop()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;############ Main Window ############&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root = tk.Tk()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root.geometry(&amp;quot;545x265&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root.title(&amp;quot;《张燕的视频工具库》&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root.resizable(False, False)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;background_image = tk.PhotoImage(file=&amp;quot;m.png&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;background_label = tk.Label(root, image=background_image)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;background_label.place(x=0, y=0, relwidth=1, relheight=1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;password_label = tk.Label(root, text=&amp;quot;请输入密码以解锁功能菜单:&amp;quot;, fg=&amp;quot;red&amp;quot;, bg=&amp;quot;yellow&amp;quot;, font=(&amp;quot;Arial&amp;quot;, 12, &amp;quot;bold&amp;quot;))&amp;nbsp; # 设置背景色为黄色，字体为12号粗体&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;password_label.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;password_entry = tk.Entry(root, show=&amp;quot;$&amp;quot;, width=20)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;password_entry.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;confirm_button = tk.Button(root, text=&amp;quot;确认&amp;quot;, command=check_password, width=20, fg=&amp;quot;purple&amp;quot;, bg=&amp;quot;light green&amp;quot;, font=(&amp;quot;Arial&amp;quot;, 10, &amp;quot;bold&amp;quot;))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;confirm_button.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;password_entry.bind(&amp;quot;&amp;lt;Return&amp;gt;&amp;quot;, lambda event: check_password())&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;confirm_button.bind(&amp;quot;&amp;lt;Return&amp;gt;&amp;quot;, lambda event: check_password())&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# 将 password_label，password_entry 和 confirm_button 放到视窗 y 的中央&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root.update_idletasks()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;win_height = root.winfo_height()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;y_position = (win_height - (password_label.winfo_height() + password_entry.winfo_height() + confirm_button.winfo_height())) // 2&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;password_label.place(relx=0.5, rely=0.4, anchor=&amp;quot;center&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;password_entry.place(relx=0.5, rely=0.5, anchor=&amp;quot;center&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;confirm_button.place(relx=0.5, rely=0.62, anchor=&amp;quot;center&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;menubar = tk.Menu(root)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;filemenu = tk.Menu(menubar, tearoff=0, activebackground=&amp;#39;red&amp;#39;, activeforeground=&amp;#39;yellow&amp;#39;,bg=&amp;#39;light green&amp;#39;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;filemenu.add_command(label=&amp;quot;Keygen&amp;quot;, command=show_win7_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;filemenu.add_command(label=&amp;quot;批量修改MP4视频的MD5&amp;quot;, command=show_win10_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;othermenu = tk.Menu(menubar, tearoff=0, activebackground=&amp;#39;red&amp;#39;, activeforeground=&amp;#39;yellow&amp;#39;,bg=&amp;#39;light green&amp;#39;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;othermenu.add_command(label=&amp;quot;文字转自然朗读工具&amp;quot;, command=show_win11_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;othermenu.add_command(label=&amp;quot;MP4视频帧提取及分割工具&amp;quot;, command=show_win12_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;othermenu.add_command(label=&amp;quot;Win01&amp;quot;, command=show_win01_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;menubar.add_cascade(label=&amp;quot;Open&amp;quot;, menu=filemenu)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;menubar.add_cascade(label=&amp;quot;Other&amp;quot;, menu=othermenu)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;menubar.add_command(label=&amp;quot;Close&amp;quot;, command=root.destroy)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# 禁用所有菜单项，需要密码验证后才启用&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;menubar.entryconfig(&amp;quot;Open&amp;quot;, state=&amp;quot;disabled&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;menubar.entryconfig(&amp;quot;Other&amp;quot;, state=&amp;quot;disabled&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;menubar.entryconfig(&amp;quot;Close&amp;quot;, state=&amp;quot;disabled&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root.config(menu=menubar)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;root.mainloop()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Thu, 25 Jan 2024 16:24:16 +0800</pubDate></item><item><title>Keygen</title><link>https://knature.top/?id=120</link><description>&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import tkinter as tk&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;from tkinter import ttk&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def show_selected_key():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; selected = dropdown.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if selected == &amp;#39;win7&amp;#39;:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_box.delete(1.0, tk.END)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_box.insert(tk.END, &amp;#39;win7 key: 123456&amp;#39;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; elif selected == &amp;#39;win10&amp;#39;:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_box.delete(1.0, tk.END)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text_box.insert(tk.END, &amp;#39;1. Windows PowerShell (Admin) \n\n2. irm https://massgrave.dev/get | iex \n\n3. Enter 1 and press Enter&amp;#39;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# 创建主窗口&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;window = tk.Tk()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;window.geometry(&amp;quot;720x180&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;window.title(&amp;quot;Keygen&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;window.resizable(False, False)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# 设置窗口背景图&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;background_image = tk.PhotoImage(file=&amp;quot;background.png&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;background_label = tk.Label(window, image=background_image)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;background_label.place(x=0, y=0, relwidth=1, relheight=1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# 创建下拉式选择菜单&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;dropdown = ttk.Combobox(window, values=[&amp;#39;win7&amp;#39;, &amp;#39;win10&amp;#39;])&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;dropdown.pack(side=tk.LEFT, anchor=tk.NW)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;#tk.N：北方向（顶部中心）。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;#tk.NE：东北方向（右上角）。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;#tk.E：东方向（右侧中心）。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;#tk.SE：东南方向（右下角）。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;#tk.S：南方向（底部中心）。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;#tk.SW：西南方向（左下角）。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;#tk.W：西方向（左侧中心）。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;#tk.NW：西北方向（左上角）。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# 创建文字显示框&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;text_box = tk.Text(window, height=10, width=50)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;#text_box.pack(side=tk.RIGHT)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;text_box.place(relx=0.5, rely=0.5, anchor=&amp;quot;center&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;button = tk.Button(window, text=&amp;quot;Show Key&amp;quot;, command=show_selected_key)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;button.place(relx=0.175, rely=0.5, anchor=&amp;quot;center&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;#button.pack(side=tk.LEFT, anchor=tk.S)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# 运行主循环&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;window.mainloop()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 24 Jan 2024 15:44:15 +0800</pubDate></item><item><title>Login Page for Tkinter</title><link>https://knature.top/?id=119</link><description>&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import tkinter as tk&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;from tkinter import messagebox&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;import mysql.connector&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def connect_MYSQL():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; connection = mysql.connector.connect(&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; host=&amp;quot;ithome.uk.to&amp;quot;,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; user=&amp;quot;colab&amp;quot;,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; password=&amp;quot;kerek564123&amp;quot;,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; database=&amp;quot;colab&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; cursor = connection.cursor()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; query = &amp;quot;SELECT * FROM colab&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; cursor.execute(query)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; result = cursor.fetchall()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; return result&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def login():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; username = username_entry.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; password = password_entry.get()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; if username == connect_MYSQL()[0][0] and password == connect_MYSQL()[0][1]:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; show_content_page()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; else:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messagebox.showerror(&amp;quot;Login Failed&amp;quot;, &amp;quot;Invalid username or password&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;def show_content_page():&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; login_window.destroy()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; content = tk.Tk()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; content.resizable(False, False)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; labels = [&amp;quot;Server:&amp;quot;, &amp;quot;Port:&amp;quot;, &amp;quot;Password:&amp;quot;, &amp;quot;Encrypt Method:&amp;quot;]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; for index, label_text in enumerate(labels, start=1):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; label = tk.Label(content, text=label_text, font=(&amp;quot;Arial&amp;quot;, 20))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; label.grid(row=index, column=0, padx=5, pady=5, sticky=tk.W)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry = tk.Entry(content)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry.insert(tk.END, str(connect_MYSQL()[0][index - 1]))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry.config(font=(&amp;quot;Arial&amp;quot;, 16))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry.grid(row=index, column=1, padx=5, pady=5)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; content.mainloop()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# Create login window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;login_window = tk.Tk()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;login_window.geometry(&amp;quot;320x180&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;login_window.title(&amp;quot;Login Page&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;login_window.resizable(False, False)&amp;nbsp; &amp;nbsp;# Restrict the size of window&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# input box for username&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;username_label = tk.Label(login_window, text=&amp;quot;Username:&amp;quot;, font=(&amp;quot;Arial&amp;quot;, 16))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;username_label.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;username_entry = tk.Entry(login_window)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;username_entry.config(font=(&amp;quot;Arial&amp;quot;, 14))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;username_entry.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# input box for password&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;password_label = tk.Label(login_window, text=&amp;quot;Password:&amp;quot;, font=(&amp;quot;Arial&amp;quot;, 16))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;password_label.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;password_entry = tk.Entry(login_window, show=&amp;quot;*&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;password_entry.config(font=(&amp;quot;Arial&amp;quot;, 14))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;password_entry.pack()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;# Login button&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;login_button = tk.Button(login_window, text=&amp;quot;Login&amp;quot;, command=login)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;login_button.config(font=(&amp;quot;Arial&amp;quot;, 14))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;login_button.pack(pady=10)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;login_window.mainloop()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;============================================================================&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;Generation of .exe --- pip install pyinstaller&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;pyinstaller -F -w --icon=photo.ico test.py&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 24 Jan 2024 13:35:45 +0800</pubDate></item><item><title>Win10 and 11 Activation Method</title><link>https://knature.top/?id=117</link><description>&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;1. Windows PowerShell (Admin)&lt;/p&gt;&lt;p&gt;2. irm https://massgrave.dev/get | iex&lt;/p&gt;&lt;p&gt;3. Enter 1 and press Enter&lt;/p&gt;</description><pubDate>Sun, 07 Jan 2024 17:24:55 +0800</pubDate></item><item><title>text to speech</title><link>https://knature.top/?id=116</link><description>&lt;p&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;!&lt;/span&gt;wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1&lt;span style=&quot;color: #098658&quot;&gt;.1&lt;/span&gt;_1&lt;span style=&quot;color: #098658&quot;&gt;.1.1&lt;/span&gt;f-&lt;span style=&quot;color: #098658&quot;&gt;1&lt;/span&gt;ubuntu2_amd64.deb&lt;span style=&quot;color: #0000ff&quot;&gt;!&lt;/span&gt;sudo dpkg -i libssl1&lt;span style=&quot;color: #098658&quot;&gt;.1&lt;/span&gt;_1&lt;span style=&quot;color: #098658&quot;&gt;.1.1&lt;/span&gt;f-&lt;span style=&quot;color: #098658&quot;&gt;1&lt;/span&gt;ubuntu2_amd64.deb&lt;span style=&quot;color: #0000ff&quot;&gt;!&lt;/span&gt;pip install azure-cognitiveservices-speech&lt;br/&gt;&lt;span style=&quot;color: #af00db&quot;&gt;import&lt;/span&gt; os&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #af00db&quot;&gt;from&lt;/span&gt; google.colab &lt;span style=&quot;color: #af00db&quot;&gt;import&lt;/span&gt; drive&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #af00db&quot;&gt;from&lt;/span&gt; google.colab &lt;span style=&quot;color: #af00db&quot;&gt;import&lt;/span&gt; files&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #af00db&quot;&gt;from&lt;/span&gt; google.colab &lt;span style=&quot;color: #af00db&quot;&gt;import&lt;/span&gt; auth&lt;/p&gt;&lt;p&gt;drive.mount(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;#39;/content/drive&amp;#39;&lt;/span&gt;, force_remount=&lt;span style=&quot;color: #0000ff&quot;&gt;True&lt;/span&gt;)&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span style=&quot;color: #af00db&quot;&gt;from&lt;/span&gt; azure.cognitiveservices.speech &lt;span style=&quot;color: #af00db&quot;&gt;import&lt;/span&gt; AudioDataStream, SpeechSynthesizer&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #af00db&quot;&gt;from&lt;/span&gt; azure.cognitiveservices.speech.audio &lt;span style=&quot;color: #af00db&quot;&gt;import&lt;/span&gt; AudioOutputConfig&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #af00db&quot;&gt;import&lt;/span&gt; azure.cognitiveservices.speech &lt;span style=&quot;color: #af00db&quot;&gt;as&lt;/span&gt; speechsdk&lt;/p&gt;&lt;p&gt;&lt;br/&gt;speech_key, service_region = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;4b91ee619ca64223834f8d36f3883758&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;westeurope&amp;quot;&lt;/span&gt;speech_config = speechsdk.SpeechConfig(subscription=speech_key, region=service_region)&lt;/p&gt;&lt;p&gt;synthesizer = SpeechSynthesizer(speech_config=speech_config)&lt;/p&gt;&lt;p&gt;&lt;br/&gt;texts = [&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;我现在声音自然多了吧&amp;quot;&lt;/span&gt;,&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;都选择白嫖免费使用的就完事，注意要选择美国东部的服务&amp;quot;&lt;/span&gt;,&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;其他的名称只要是不重复就可以随便填，填写好就可以看到自己的key了&amp;quot;&lt;/span&gt;]&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #008000&quot;&gt;#voice_name = &amp;quot;zh-CN-XiaoxiaoNeural&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;voice_name = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;zh-CN-YunxiNeural&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;ssmls = []&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #af00db&quot;&gt;for&lt;/span&gt; text &lt;span style=&quot;color: #0000ff&quot;&gt;in&lt;/span&gt; texts:&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; ssml = &lt;span style=&quot;color: #0000ff&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;&amp;lt;speak version=&amp;#39;1.0&amp;#39; xml:lang=&amp;#39;zh-CN&amp;#39; xmlns=&amp;#39;http://www.w3.org/2001/10/synthesis&amp;#39; xmlns:mstts=&amp;#39;http://www.w3.org/2001/mstts&amp;#39;&amp;gt;&amp;lt;voice name=&amp;#39;&lt;/span&gt;{voice_name}&lt;span style=&quot;color: #a31515&quot;&gt;&amp;#39;&amp;gt;&amp;lt;bookmark mark=&amp;#39;bookmark_one&amp;#39;/&amp;gt;&lt;/span&gt;{text}&lt;span style=&quot;color: #a31515&quot;&gt;&amp;lt;/voice&amp;gt;&amp;lt;/speak&amp;gt;&amp;quot;&lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; ssmls.append(ssml)&lt;br/&gt;&lt;span style=&quot;color: #af00db&quot;&gt;for&lt;/span&gt; i, ssml &lt;span style=&quot;color: #0000ff&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #795e26&quot;&gt;enumerate&lt;/span&gt;(ssmls):&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; result = synthesizer.speak_ssml_async(ssml).get()&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; stream = AudioDataStream(result)&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; stream.save_to_wav_file(&lt;span style=&quot;color: #0000ff&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;/content/drive/My Drive/text_to_speech/sound_&lt;/span&gt;{i}&lt;span style=&quot;color: #a31515&quot;&gt;.wav&amp;quot;&lt;/span&gt;)&lt;/p&gt;</description><pubDate>Fri, 10 Nov 2023 17:17:58 +0800</pubDate></item><item><title>Refer Job in Multi Sheet Version2</title><link>https://knature.top/?id=115</link><description>&lt;div style='color: rgb(60, 64, 67); background-color: rgb(255, 255, 254); font-family: &quot;Roboto Mono&quot;, Consolas, &quot;Courier New&quot;, monospace; font-size: 13px; line-height: 18px; white-space: pre;'&gt;&lt;div&gt;&lt;span style=&quot;color: #185abc;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;findDuplicateInMultiSheets2&lt;/span&gt;() {&lt;/div&gt;&lt;div&gt;  &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;responseText&lt;/span&gt; =  &lt;span style=&quot;color: #c92786;&quot;&gt;SpreadsheetApp&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;getUi&lt;/span&gt;().&lt;span style=&quot;color: #202124;&quot;&gt;prompt&lt;/span&gt;(&lt;span style=&quot;color: #b31412;&quot;&gt;&quot;Please enter sheet names of refer job number: job1,job2,job3&quot;&lt;/span&gt;).&lt;span style=&quot;color: #202124;&quot;&gt;getResponseText&lt;/span&gt;();&lt;/div&gt;&lt;div&gt;  &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt; = &lt;span style=&quot;color: #202124;&quot;&gt;responseText&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;trim&lt;/span&gt;().&lt;span style=&quot;color: #202124;&quot;&gt;replace&lt;/span&gt;(&lt;span style=&quot;color: #7627bb;&quot;&gt;/[,]$/&lt;/span&gt;,&lt;span style=&quot;color: #b31412;&quot;&gt;&quot;&quot;&lt;/span&gt;).&lt;span style=&quot;color: #202124;&quot;&gt;split&lt;/span&gt;(&lt;span style=&quot;color: #b31412;&quot;&gt;&quot;,&quot;&lt;/span&gt;).&lt;span style=&quot;color: #202124;&quot;&gt;map&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;item&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #202124;&quot;&gt;item&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;toString&lt;/span&gt;().&lt;span style=&quot;color: #202124;&quot;&gt;trim&lt;/span&gt;());&lt;/div&gt;&lt;div&gt;  &lt;/div&gt;&lt;div&gt;  &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;allSheetsData&lt;/span&gt; = &lt;span style=&quot;color: #202124;&quot;&gt;getAllSheetsData&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;);&lt;/div&gt;&lt;div&gt;  &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;duplicateData&lt;/span&gt; = &lt;span style=&quot;color: #202124;&quot;&gt;getAllSheetsDuplicatesData&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;allSheetsData&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;);&lt;/div&gt;&lt;div&gt;  &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;duplicateIndex&lt;/span&gt; = &lt;span style=&quot;color: #202124;&quot;&gt;getAllSheetsDuplicatesIndex&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;allSheetsData&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;duplicateData&lt;/span&gt;);&lt;/div&gt;&lt;div&gt;  &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;referList&lt;/span&gt; = &lt;span style=&quot;color: #202124;&quot;&gt;getReferString&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;duplicateData&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;duplicateIndex&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;);&lt;/div&gt;&lt;br&gt;&lt;div&gt;  &lt;span style=&quot;color: #202124;&quot;&gt;setReferComponents&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;duplicateIndex&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;referList&lt;/span&gt;);&lt;/div&gt;&lt;br&gt;&lt;div&gt;  &lt;span style=&quot;color: #185abc;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;getAllSheetsData&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;) {&lt;/div&gt;&lt;div&gt;    &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;allSheetsData&lt;/span&gt; = {};&lt;/div&gt;&lt;br&gt;&lt;div&gt;    &lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;forEach&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;sheetName&lt;/span&gt; =&amp;gt; {&lt;/div&gt;&lt;div&gt;      &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;sheet&lt;/span&gt; = &lt;span style=&quot;color: #c92786;&quot;&gt;SpreadsheetApp&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;getActiveSpreadsheet&lt;/span&gt;().&lt;span style=&quot;color: #202124;&quot;&gt;getSheetByName&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;sheetName&lt;/span&gt;);&lt;/div&gt;&lt;div&gt;      &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;lastRow&lt;/span&gt; = &lt;span style=&quot;color: #202124;&quot;&gt;sheet&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;getLastRow&lt;/span&gt;();&lt;/div&gt;&lt;br&gt;&lt;div&gt;      &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;sheetDatas&lt;/span&gt; = &lt;span style=&quot;color: #202124;&quot;&gt;sheet&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;getRange&lt;/span&gt;(&lt;span style=&quot;color: #098591;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #098591;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;lastRow&lt;/span&gt;-&lt;span style=&quot;color: #098591;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: #098591;&quot;&gt;18&lt;/span&gt;).&lt;span style=&quot;color: #202124;&quot;&gt;getDisplayValues&lt;/span&gt;();&lt;/div&gt;&lt;div&gt;      &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;columnEtoIData&lt;/span&gt; = &lt;span style=&quot;color: #202124;&quot;&gt;getReferColumnData&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;sheetDatas&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;map&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;item&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #202124;&quot;&gt;item&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;slice&lt;/span&gt;(&lt;span style=&quot;color: #098591;&quot;&gt;4&lt;/span&gt;,&lt;span style=&quot;color: #098591;&quot;&gt;9&lt;/span&gt;)));&lt;/div&gt;&lt;div&gt;      &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;columnJData&lt;/span&gt; = &lt;span style=&quot;color: #202124;&quot;&gt;getReferColumnData&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;sheetDatas&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;map&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;item&lt;/span&gt; =&amp;gt; [&lt;span style=&quot;color: #202124;&quot;&gt;item&lt;/span&gt;[&lt;span style=&quot;color: #098591;&quot;&gt;9&lt;/span&gt;]]));&lt;/div&gt;&lt;div&gt;      &lt;/div&gt;&lt;div&gt;      &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;regex&lt;/span&gt; = &lt;span style=&quot;color: #7627bb;&quot;&gt;/\bmetal\b|\bglass\b|\bceramic\b|\bmaterial\b/&lt;/span&gt;&lt;span style=&quot;color: #185abc;&quot;&gt;i&lt;/span&gt;;&lt;/div&gt;&lt;div&gt;      &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;columnEtoJData&lt;/span&gt; = &lt;span style=&quot;color: #202124;&quot;&gt;columnEtoIData&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;map&lt;/span&gt;((&lt;span style=&quot;color: #202124;&quot;&gt;item&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt;) =&amp;gt; &lt;span style=&quot;color: #202124;&quot;&gt;regex&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;test&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;item&lt;/span&gt;)? (&lt;span style=&quot;color: #202124;&quot;&gt;item&lt;/span&gt;+&lt;span style=&quot;color: #b31412;&quot;&gt;&quot; (&quot;&lt;/span&gt;+&lt;span style=&quot;color: #202124;&quot;&gt;columnJData&lt;/span&gt;[&lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt;]+&lt;span style=&quot;color: #b31412;&quot;&gt;&quot;)&quot;&lt;/span&gt;).&lt;span style=&quot;color: #202124;&quot;&gt;trim&lt;/span&gt;() : &lt;span style=&quot;color: #202124;&quot;&gt;item&lt;/span&gt;);&lt;/div&gt;&lt;div&gt;      &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;columnKData&lt;/span&gt; = &lt;span style=&quot;color: #202124;&quot;&gt;sheetDatas&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;map&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;item&lt;/span&gt; =&amp;gt; {&lt;/div&gt;&lt;div&gt;        &lt;span style=&quot;color: #185abc;&quot;&gt;if&lt;/span&gt;(&lt;span style=&quot;color: #7627bb;&quot;&gt;/packaging/&lt;/span&gt;&lt;span style=&quot;color: #185abc;&quot;&gt;i&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;test&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;item&lt;/span&gt;[&lt;span style=&quot;color: #098591;&quot;&gt;10&lt;/span&gt;])) &lt;/div&gt;&lt;div&gt;          &lt;span style=&quot;color: #185abc;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #b31412;&quot;&gt;&quot;(packaging)&quot;&lt;/span&gt;;&lt;/div&gt;&lt;br&gt;&lt;div&gt;        &lt;span style=&quot;color: #185abc;&quot;&gt;if&lt;/span&gt;(&lt;span style=&quot;color: #7627bb;&quot;&gt;/internal/&lt;/span&gt;&lt;span style=&quot;color: #185abc;&quot;&gt;i&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;test&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;item&lt;/span&gt;[&lt;span style=&quot;color: #098591;&quot;&gt;10&lt;/span&gt;])) &lt;/div&gt;&lt;div&gt;          &lt;span style=&quot;color: #185abc;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #b31412;&quot;&gt;&quot;(internal)&quot;&lt;/span&gt;;&lt;/div&gt;&lt;br&gt;&lt;div&gt;        &lt;span style=&quot;color: #185abc;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #b31412;&quot;&gt;&quot;&quot;&lt;/span&gt;;&lt;/div&gt;&lt;div&gt;      });&lt;/div&gt;&lt;br&gt;&lt;div&gt;      &lt;span style=&quot;color: #202124;&quot;&gt;allSheetsData&lt;/span&gt;[&lt;span style=&quot;color: #202124;&quot;&gt;sheetName&lt;/span&gt;] = &lt;span style=&quot;color: #202124;&quot;&gt;columnEtoJData&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;map&lt;/span&gt;((&lt;span style=&quot;color: #202124;&quot;&gt;component&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt;) =&amp;gt; (&lt;span style=&quot;color: #202124;&quot;&gt;component&lt;/span&gt;+&lt;span style=&quot;color: #b31412;&quot;&gt;&quot; &quot;&lt;/span&gt;+&lt;span style=&quot;color: #202124;&quot;&gt;columnKData&lt;/span&gt;[&lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt;]).&lt;span style=&quot;color: #202124;&quot;&gt;trim&lt;/span&gt;());&lt;/div&gt;&lt;div&gt;    })&lt;/div&gt;&lt;div&gt;    &lt;span style=&quot;color: #185abc;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;allSheetsData&lt;/span&gt;;&lt;/div&gt;&lt;div&gt;  }&lt;/div&gt;&lt;br&gt;&lt;div&gt;  &lt;span style=&quot;color: #185abc;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;getReferColumnData&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;sheetData&lt;/span&gt;) {&lt;/div&gt;&lt;div&gt;    &lt;span style=&quot;color: #185abc;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;sheetData&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;map&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;arr&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #202124;&quot;&gt;arr&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;map&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;str&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #202124;&quot;&gt;str&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;toLowerCase&lt;/span&gt;()&lt;/div&gt;&lt;div&gt;      .&lt;span style=&quot;color: #202124;&quot;&gt;trim&lt;/span&gt;()&lt;/div&gt;&lt;div&gt;      .&lt;span style=&quot;color: #202124;&quot;&gt;replace&lt;/span&gt;(&lt;span style=&quot;color: #7627bb;&quot;&gt;/\-/&lt;/span&gt;&lt;span style=&quot;color: #185abc;&quot;&gt;g&lt;/span&gt;,&lt;span style=&quot;color: #b31412;&quot;&gt;&quot;&quot;&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;      .&lt;span style=&quot;color: #202124;&quot;&gt;replace&lt;/span&gt;(&lt;span style=&quot;color: #7627bb;&quot;&gt;/\s+/&lt;/span&gt;&lt;span style=&quot;color: #185abc;&quot;&gt;g&lt;/span&gt;,&lt;span style=&quot;color: #b31412;&quot;&gt;&quot; &quot;&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;      .&lt;span style=&quot;color: #202124;&quot;&gt;replace&lt;/span&gt;(&lt;span style=&quot;color: #7627bb;&quot;&gt;/colour/&lt;/span&gt;&lt;span style=&quot;color: #185abc;&quot;&gt;g&lt;/span&gt;,&lt;span style=&quot;color: #b31412;&quot;&gt;&quot;color&quot;&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;    ).&lt;span style=&quot;color: #202124;&quot;&gt;filter&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;value&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #202124;&quot;&gt;value&lt;/span&gt; !== &lt;span style=&quot;color: #b31412;&quot;&gt;&quot;&quot;&lt;/span&gt;).&lt;span style=&quot;color: #202124;&quot;&gt;join&lt;/span&gt;(&lt;span style=&quot;color: #b31412;&quot;&gt;&quot; &quot;&lt;/span&gt;));&lt;/div&gt;&lt;div&gt;  }&lt;/div&gt;&lt;br&gt;&lt;div&gt;  &lt;span style=&quot;color: #185abc;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;getAllSheetsDuplicatesData&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;allSheetsData&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;) {&lt;/div&gt;&lt;div&gt;    &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;duplicateData&lt;/span&gt; = [];&lt;/div&gt;&lt;div&gt;    &lt;span style=&quot;color: #185abc;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt;=&lt;span style=&quot;color: #098591;&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;length&lt;/span&gt;;&lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt;++) {&lt;/div&gt;&lt;div&gt;      &lt;span style=&quot;color: #185abc;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;j&lt;/span&gt;=&lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt;+&lt;span style=&quot;color: #098591;&quot;&gt;1&lt;/span&gt;;&lt;span style=&quot;color: #202124;&quot;&gt;j&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;length&lt;/span&gt;;&lt;span style=&quot;color: #202124;&quot;&gt;j&lt;/span&gt;++) {&lt;/div&gt;&lt;div&gt;        &lt;span style=&quot;color: #202124;&quot;&gt;duplicateData&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;push&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;findDuplicate&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;allSheetsData&lt;/span&gt;[&lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;[&lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt;]],&lt;span style=&quot;color: #202124;&quot;&gt;allSheetsData&lt;/span&gt;[&lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;[&lt;span style=&quot;color: #202124;&quot;&gt;j&lt;/span&gt;]]));&lt;/div&gt;&lt;div&gt;      }&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;    &lt;span style=&quot;color: #185abc;&quot;&gt;return&lt;/span&gt; [].&lt;span style=&quot;color: #202124;&quot;&gt;concat&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;apply&lt;/span&gt;([],&lt;span style=&quot;color: #202124;&quot;&gt;duplicateData&lt;/span&gt;).&lt;span style=&quot;color: #202124;&quot;&gt;filter&lt;/span&gt;((&lt;span style=&quot;color: #202124;&quot;&gt;element&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;index&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;arr&lt;/span&gt;) =&amp;gt; &lt;span style=&quot;color: #202124;&quot;&gt;arr&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;indexOf&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;element&lt;/span&gt;) === &lt;span style=&quot;color: #202124;&quot;&gt;index&lt;/span&gt;);&lt;/div&gt;&lt;div&gt;  }&lt;/div&gt;&lt;br&gt;&lt;div&gt;  &lt;span style=&quot;color: #185abc;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;findDuplicate&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;sheet1&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;sheet2&lt;/span&gt;) {&lt;/div&gt;&lt;div&gt;    &lt;span style=&quot;color: #185abc;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;sheet1&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;filter&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;value&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #202124;&quot;&gt;sheet2&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;includes&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;value&lt;/span&gt;) &amp;amp;&amp;amp; &lt;span style=&quot;color: #202124;&quot;&gt;value&lt;/span&gt; !== &lt;span style=&quot;color: #b31412;&quot;&gt;&quot;&quot;&lt;/span&gt;);&lt;/div&gt;&lt;div&gt;  }&lt;/div&gt;&lt;br&gt;&lt;div&gt;  &lt;span style=&quot;color: #185abc;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;getAllSheetsDuplicatesIndex&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;allSheetsData&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;duplicateData&lt;/span&gt;) {&lt;/div&gt;&lt;div&gt;    &lt;span style=&quot;color: #185abc;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;reduce&lt;/span&gt;((&lt;span style=&quot;color: #202124;&quot;&gt;acc&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;sheetName&lt;/span&gt;) =&amp;gt; (&lt;span style=&quot;color: #202124;&quot;&gt;acc&lt;/span&gt;[&lt;span style=&quot;color: #202124;&quot;&gt;sheetName&lt;/span&gt;] = &lt;span style=&quot;color: #202124;&quot;&gt;getRepeatDataIndex&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;duplicateData&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;allSheetsData&lt;/span&gt;[&lt;span style=&quot;color: #202124;&quot;&gt;sheetName&lt;/span&gt;]), &lt;span style=&quot;color: #202124;&quot;&gt;acc&lt;/span&gt;), {});&lt;/div&gt;&lt;div&gt;  }&lt;/div&gt;&lt;br&gt;&lt;div&gt;  &lt;span style=&quot;color: #185abc;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;getRepeatDataIndex&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;duplicateData&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;sheetData&lt;/span&gt;) {&lt;/div&gt;&lt;div&gt;    &lt;span style=&quot;color: #185abc;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;duplicateData&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;map&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;duplicate&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #202124;&quot;&gt;sheetData&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;map&lt;/span&gt;((&lt;span style=&quot;color: #202124;&quot;&gt;component&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt;) =&amp;gt; &lt;span style=&quot;color: #202124;&quot;&gt;duplicate&lt;/span&gt; === &lt;span style=&quot;color: #202124;&quot;&gt;component&lt;/span&gt; ? (&lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt;+&lt;span style=&quot;color: #098591;&quot;&gt;1&lt;/span&gt;) : &lt;span style=&quot;color: #185abc;&quot;&gt;null&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;    .&lt;span style=&quot;color: #202124;&quot;&gt;filter&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt; !== &lt;span style=&quot;color: #185abc;&quot;&gt;null&lt;/span&gt;));&lt;/div&gt;&lt;div&gt;  }&lt;/div&gt;&lt;br&gt;&lt;div&gt;  &lt;span style=&quot;color: #185abc;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;getReferString&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;duplicateData&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;duplicateIndex&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;) {&lt;/div&gt;&lt;div&gt;    &lt;span style=&quot;color: #185abc;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;duplicateData&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;map&lt;/span&gt;((&lt;span style=&quot;color: #202124;&quot;&gt;_&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt;) =&amp;gt; &lt;/div&gt;&lt;div&gt;      &lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;reduce&lt;/span&gt;((&lt;span style=&quot;color: #202124;&quot;&gt;arr&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;sheetName&lt;/span&gt;) =&amp;gt; (&lt;/div&gt;&lt;div&gt;        &lt;span style=&quot;color: #202124;&quot;&gt;arr&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;concat&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;duplicateIndex&lt;/span&gt;[&lt;span style=&quot;color: #202124;&quot;&gt;sheetName&lt;/span&gt;][&lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt;].&lt;span style=&quot;color: #202124;&quot;&gt;map&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;number&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #b31412;&quot;&gt;`&lt;/span&gt;${&lt;span style=&quot;color: #202124;&quot;&gt;sheetName&lt;/span&gt;}&lt;span style=&quot;color: #b31412;&quot;&gt;-&lt;/span&gt;${&lt;span style=&quot;color: #202124;&quot;&gt;number&lt;/span&gt;}&lt;span style=&quot;color: #b31412;&quot;&gt;;`&lt;/span&gt;))&lt;/div&gt;&lt;div&gt;      ), []).&lt;span style=&quot;color: #202124;&quot;&gt;join&lt;/span&gt;(&lt;span style=&quot;color: #b31412;&quot;&gt;&quot;&quot;&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;    );&lt;/div&gt;&lt;div&gt;  }&lt;/div&gt;&lt;br&gt;&lt;div&gt;  &lt;span style=&quot;color: #185abc;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;setReferComponents&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;duplicateIndex&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;referList&lt;/span&gt;) {&lt;/div&gt;&lt;div&gt;    &lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;forEach&lt;/span&gt;((&lt;span style=&quot;color: #202124;&quot;&gt;sheetName&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt;) =&amp;gt; {&lt;/div&gt;&lt;div&gt;      &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;sheet&lt;/span&gt; = &lt;span style=&quot;color: #c92786;&quot;&gt;SpreadsheetApp&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;getActiveSpreadsheet&lt;/span&gt;().&lt;span style=&quot;color: #202124;&quot;&gt;getSheetByName&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;sheetName&lt;/span&gt;);&lt;/div&gt;&lt;div&gt;      &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;regString&lt;/span&gt; = &lt;span style=&quot;color: #202124;&quot;&gt;sheetNames&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;slice&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;i&lt;/span&gt;,).&lt;span style=&quot;color: #202124;&quot;&gt;map&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;item&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #b31412;&quot;&gt;`&lt;/span&gt;${&lt;span style=&quot;color: #202124;&quot;&gt;item&lt;/span&gt;}&lt;span style=&quot;color: #b31412;&quot;&gt;(.*?);`&lt;/span&gt;).&lt;span style=&quot;color: #202124;&quot;&gt;join&lt;/span&gt;(&lt;span style=&quot;color: #b31412;&quot;&gt;&quot;|&quot;&lt;/span&gt;);&lt;/div&gt;&lt;div&gt;      &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;reg&lt;/span&gt; = &lt;span style=&quot;color: #185abc;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #c92786;&quot;&gt;RegExp&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;regString&lt;/span&gt;, &lt;span style=&quot;color: #b31412;&quot;&gt;&quot;g&quot;&lt;/span&gt;);&lt;/div&gt;&lt;br&gt;&lt;div&gt;      &lt;span style=&quot;color: #202124;&quot;&gt;duplicateIndex&lt;/span&gt;[&lt;span style=&quot;color: #202124;&quot;&gt;sheetName&lt;/span&gt;].&lt;span style=&quot;color: #202124;&quot;&gt;forEach&lt;/span&gt;((&lt;span style=&quot;color: #202124;&quot;&gt;sheetData&lt;/span&gt;,&lt;span style=&quot;color: #202124;&quot;&gt;index&lt;/span&gt;) =&amp;gt; &lt;span style=&quot;color: #202124;&quot;&gt;sheetData&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;forEach&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;sheetRow&lt;/span&gt; =&amp;gt; {&lt;/div&gt;&lt;div&gt;        &lt;span style=&quot;color: #185abc;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #202124;&quot;&gt;referStatement&lt;/span&gt; = &lt;span style=&quot;color: #202124;&quot;&gt;referList&lt;/span&gt;[&lt;span style=&quot;color: #202124;&quot;&gt;index&lt;/span&gt;].&lt;span style=&quot;color: #202124;&quot;&gt;replace&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;reg&lt;/span&gt;,&lt;span style=&quot;color: #b31412;&quot;&gt;&quot;&quot;&lt;/span&gt;);&lt;/div&gt;&lt;br&gt;&lt;div&gt;        &lt;span style=&quot;color: #185abc;&quot;&gt;if&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;referStatement&lt;/span&gt;) &lt;/div&gt;&lt;div&gt;          &lt;span style=&quot;color: #202124;&quot;&gt;sheet&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;getRange&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;sheetRow&lt;/span&gt;+&lt;span style=&quot;color: #098591;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: #098591;&quot;&gt;4&lt;/span&gt;).&lt;span style=&quot;color: #202124;&quot;&gt;setValue&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;referStatement&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;match&lt;/span&gt;(&lt;span style=&quot;color: #7627bb;&quot;&gt;/(.*?);/&lt;/span&gt;)[&lt;span style=&quot;color: #098591;&quot;&gt;1&lt;/span&gt;]);&lt;/div&gt;&lt;div&gt;        &lt;span style=&quot;color: #185abc;&quot;&gt;else&lt;/span&gt; &lt;/div&gt;&lt;div&gt;          &lt;span style=&quot;color: #202124;&quot;&gt;sheet&lt;/span&gt;.&lt;span style=&quot;color: #202124;&quot;&gt;getRange&lt;/span&gt;(&lt;span style=&quot;color: #202124;&quot;&gt;sheetRow&lt;/span&gt;+&lt;span style=&quot;color: #098591;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: #098591;&quot;&gt;4&lt;/span&gt;).&lt;span style=&quot;color: #202124;&quot;&gt;setValue&lt;/span&gt;(&lt;span style=&quot;color: #b31412;&quot;&gt;&quot;TBR&quot;&lt;/span&gt;);&lt;/div&gt;&lt;div&gt;        })&lt;/div&gt;&lt;div&gt;      )&lt;/div&gt;&lt;div&gt;    })&lt;/div&gt;&lt;div&gt;  }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description><pubDate>Tue, 18 Apr 2023 21:38:59 +0800</pubDate></item></channel></rss><!--68.97 ms , 6 queries , 814kb memory , 0 error-->