tkinter程序用pyinstaller打包成单个exe后wav资源调用失败 打包时用了--add-data "a.wav;." 参数,依然不管用
做拆分pdf的时候,打包成exe,但是换台电脑,一直报如下错误,为什么TkinterDnD.py会没有贝打包进去,搜了下没找到解决方法。求解 Traceback (most recent call last): File "tkinterdnd2\TkinterDnD.py", line 53, in _require _tkinter.TclError: can't find package tkdnd During handling of the above exception, another exception occurred: Traceback (most recent call last): File "拆分pdf.py", line 91, in File "tkinterdnd2\TkinterDnD.py", line 285, in init File "tkinterdnd2\TkinterDnD.py", line 55, in _require RuntimeError: Unable to load tkdnd library. "image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20240917/7a6398d7cdd8997ad8615139efc8ef4b.png) 求解
使用的是Python,tk,我如果在一个Frame中嵌套一个Frame,外面的Frame大小设置就失灵了。 "image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20241016/5b9a59239670ba3dcaade646a552d57d.png) import customtkinter if __name__ == "__main__": app = customtkinter.CTk() app.geometry("300x300") frame = customtkinter.CTkFrame(app, width=280, height=280, fg_color="red") frame_1 = customtkinter.CTkFrame( frame, width=20, height=20, fg_color="green", corner_radius=5 ) frame_1.pack() frame_2 = customtkinter.CTkFrame( frame, width=20, height=20, fg_color="blue", corner_radius=5 ) frame_2.pack() frame.pack() app.mainloop() 本来是想做一组小Frame在里面,然后更随窗口大小变化的。 m*n行,最后一行可能不填满这个样子。