from tkinter import *
class DirList(object): def __init__(self,initdir=None): self.top= Tk() ##可以不加tkinter前缀 self.label = Label(self.top, text="Directory Lister V1.1") ##可以不加tkinter前缀 self.label.pack()
import tkinter
class DirList(object): def __init__(self,initdir=None): self.top= tkinter.Tk() ##必须加tkinter前缀 self.label = tkinter.Label(self.top, text="Directory Lister V1.1") ##必须加tkinter前缀 self.label.pack()