Trying to fix “AttributeError: ‘NoneType’ object has no attribute ‘configure'” /u/GianMc18 Python Education

I’m working on a program to sort files, and the functionality is complete. Now, I’ve started creating a GUI, but I’m encountering an issue. I tried using the .pack() method with a Label testsss.pack, but it’s not working as expected and been trying anything in the past hr now. Any suggestions or fixes would be greatly appreciated!

import tkinter as tk from tkinter import ttk from tkinter import filedialog PathL = '' def btnClickFunction1(): global testsss PathL = filedialog.askdirectory() testsss.configure(text=PathL) def btnClickFunction2(): print('test2') def btnClickFunction3(): print('test3') def RunScrips(): print('run program') def window_exit(): root.destroy() root = Tk() root.geometry('632x410') root.configure(background='#EEAD0E') root.title('Auto Sorter') Button(root, text='To Path', bg='#F0F8FF', font=('arial', 12, 'normal'), command=btnClickFunction1).place(x=25, y=253) Button(root, text='From Path', bg='#F0F8FF', font=('arial', 12, 'normal'), command=btnClickFunction2).place(x=25, y=293) Button(root, text='Excel Path', bg='#F0F8FF', font=('arial', 12, 'normal'), command=btnClickFunction3).place(x=25, y=333) Button(root, text='Run', bg='#F0F8FF', font=('arial', 17, 'normal'), command=RunScrips).place(x=275, y=103) testsss = Label(root, text=PathL, bg='#EEAD0E', font=('arial', 17, 'normal')).place(x=115, y=263) root.protocol("WM_DELETE_WINDOW", window_exit) root.mainloop() 

submitted by /u/GianMc18
[link] [comments]

​r/learnpython I’m working on a program to sort files, and the functionality is complete. Now, I’ve started creating a GUI, but I’m encountering an issue. I tried using the .pack() method with a Label testsss.pack, but it’s not working as expected and been trying anything in the past hr now. Any suggestions or fixes would be greatly appreciated! import tkinter as tk from tkinter import ttk from tkinter import filedialog PathL = ” def btnClickFunction1(): global testsss PathL = filedialog.askdirectory() testsss.configure(text=PathL) def btnClickFunction2(): print(‘test2’) def btnClickFunction3(): print(‘test3’) def RunScrips(): print(‘run program’) def window_exit(): root.destroy() root = Tk() root.geometry(‘632×410′) root.configure(background=’#EEAD0E’) root.title(‘Auto Sorter’) Button(root, text=’To Path’, bg=’#F0F8FF’, font=(‘arial’, 12, ‘normal’), command=btnClickFunction1).place(x=25, y=253) Button(root, text=’From Path’, bg=’#F0F8FF’, font=(‘arial’, 12, ‘normal’), command=btnClickFunction2).place(x=25, y=293) Button(root, text=’Excel Path’, bg=’#F0F8FF’, font=(‘arial’, 12, ‘normal’), command=btnClickFunction3).place(x=25, y=333) Button(root, text=’Run’, bg=’#F0F8FF’, font=(‘arial’, 17, ‘normal’), command=RunScrips).place(x=275, y=103) testsss = Label(root, text=PathL, bg=’#EEAD0E’, font=(‘arial’, 17, ‘normal’)).place(x=115, y=263) root.protocol(“WM_DELETE_WINDOW”, window_exit) root.mainloop() submitted by /u/GianMc18 [link] [comments] 

I’m working on a program to sort files, and the functionality is complete. Now, I’ve started creating a GUI, but I’m encountering an issue. I tried using the .pack() method with a Label testsss.pack, but it’s not working as expected and been trying anything in the past hr now. Any suggestions or fixes would be greatly appreciated!

import tkinter as tk from tkinter import ttk from tkinter import filedialog PathL = '' def btnClickFunction1(): global testsss PathL = filedialog.askdirectory() testsss.configure(text=PathL) def btnClickFunction2(): print('test2') def btnClickFunction3(): print('test3') def RunScrips(): print('run program') def window_exit(): root.destroy() root = Tk() root.geometry('632x410') root.configure(background='#EEAD0E') root.title('Auto Sorter') Button(root, text='To Path', bg='#F0F8FF', font=('arial', 12, 'normal'), command=btnClickFunction1).place(x=25, y=253) Button(root, text='From Path', bg='#F0F8FF', font=('arial', 12, 'normal'), command=btnClickFunction2).place(x=25, y=293) Button(root, text='Excel Path', bg='#F0F8FF', font=('arial', 12, 'normal'), command=btnClickFunction3).place(x=25, y=333) Button(root, text='Run', bg='#F0F8FF', font=('arial', 17, 'normal'), command=RunScrips).place(x=275, y=103) testsss = Label(root, text=PathL, bg='#EEAD0E', font=('arial', 17, 'normal')).place(x=115, y=263) root.protocol("WM_DELETE_WINDOW", window_exit) root.mainloop() 

submitted by /u/GianMc18
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *