def __init__(self, master, *args, **kwargs):
super().__init__(master, *args, **kwargs)
self.title("Convert File")
self.master = master
self.file_opt = options = {}
options['defaultextension'] = '.txt'
options['filetypes'] = [('text files', '.txt')]
options['initialdir'] = "C:\\Users\\%s\\" % getpass.getuser()
options['parent'] = master
options['title'] = "Choose a file"
self.grid_columnconfigure(1, weight=1)
msg = Label(self, text="Convert tab delineated .txt to .xlsx.")
msg.grid(row=0, columnspan=3, pady=(10, 4), padx=5)
lab = Label(self, text="Text file: ")
lab.grid(row=1, column=0, padx=5)
# this stores the displayed version of the filename
self.v_display = StringVar()
b1 = ttk.Button(self, text="Browse...", command=self.askopenfilename)
b1.grid(row=1, column=1, padx=5)
self.geometry('190x80+300+300')
评论列表
文章目录