Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
User interface 从python 3中的Gui导入*?_User Interface_Python 3.x_Importerror - Fatal编程技术网

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
,您需要安装