我已经创建了两个Tkinter GUI文件,我想通过单击按钮打开第二个文件和第一个文件。我做了一个函数,它只导入第二个文件,但它不工作。代码如下:
def receiver_func():
exec(open('receiver.py').read()) #None of them is working and raising error
import receiver
同时,如果我单独打开这两个文件,它们会运行良好且平滑
以下是错误日志:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\PAKLAP.pk\AppData\Local\Programs\Python\Python36\lib\tkinter\__init__.py", line 1705, in __call__
return self.func(*args)
File "D:/Programming Projects/Investors Foundation/main.py", line 16, in receiver_func
exec(open('receiver.py').read())
File "<string>", line 26, in <module>
File "C:\Users\PAKLAP.pk\AppData\Local\Programs\Python\Python36\lib\tkinter\__init__.py", line 2766, in __init__
Widget.__init__(self, master, 'label', cnf, kw)
File "C:\Users\PAKLAP.pk\AppData\Local\Programs\Python\Python36\lib\tkinter\__init__.py", line 2299, in __init__
(widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError: image "pyimage3" doesn't exist
目前没有回答
相关问题 更多 >
编程相关推荐