User interface 从python 3中的Gui导入*?
我正在尝试这个:User interface 从python 3中的Gui导入*?,user-interface,python-3.x,importerror,User Interface,Python 3.x,Importerror,我正在尝试这个: import os, sys from Gui import * import Image as PIL import ImageTk class ImageBrowser(Gui): def __init__(self): Gui.__init__(self) self.button = self.bu(command=self.quit, relief=FLAT) def image_loop(self, dirnam
import os, sys
from Gui import *
import Image as PIL
import ImageTk
class ImageBrowser(Gui):
def __init__(self):
Gui.__init__(self)
self.button = self.bu(command=self.quit, relief=FLAT)
def image_loop(self, dirname='.'):
files = os.listdir(dirname)
for file in files:
try:
self.show_image(file)
print (file)
self.mainloop()
except IOError:
continue
except:
break
def show_image(self, filename):
image = PIL.open(filename)
self.tkpi = ImageTk.PhotoImage(image)
self.button.config(image=self.tkpi)
def main(script, dirname='.'):
g = ImageBrowser()
g.image_loop(dirname)
if __name__ == '__main__':
main(*sys.argv)
我收到一个错误,上面写着:
从Gui导入*
ImportError:没有名为Gui的模块
我假设“从Gui导入*”在Python3中不起作用,有人知道如何在Python3中做到这一点吗?非常感谢(:如果您正在谈论 为了在Python3中使用
Gui
,您需要安装