Hey Guys,
I’m really new to python programming so I hope you can easily help me.
My plan is to take the entered company code from the entry button. When pressing the submit button oder enter on the keyboard the code should search in the excel file for the whole company name. This company name should be displayed in the 3rd button.
#create Company code
self.entry = customtkinter.CTkEntry(self.tabview2.tab(“COMPANY”))
self.entry = customtkinter.CTkEntry(self, placeholder_text=“Enter Company Code”, width=210)
self.entry.grid(row=0, column=2, padx=30, pady=(10, 15), sticky=“w”)
def func():
print("Code:", self.entry.get() )
#create Submit-Button
self.main_button_1 = customtkinter.CTkButton(master=self, text=“Submit”, text_color=(“gray10”, “#DCE4EE”), width=10, command=func)
self.main_button_1.grid(row=0, column=2, padx=35, pady=(10,15), sticky=“e”)
#get Code and Company name
df= pd.read_excel("C:\\Users\\angelina\\Downloads\Code.xlsx")
print(df)
print(df['COMPANY'].where(df['Company-Code'] == 4146))
Company_Code= (df['COMPANY'].where(df['Company-Code'] == 4146))
print(Company_Code.dropna())
Company_Code= customtkinter.StringVar()
self.string_input_button3 = customtkinter.CTkButton(self.tabview2.tab("COMPANY"))
self.string_input_button3 = customtkinter.CTkButton(master=self, fg_color="transparent", text='', textvariable=Company_Code, text_color=("gray10", "#DCE4EE"))
self.string_input_button3.configure(state="disabled")
self.string_input_button3.grid(row=0, column=2, padx=(20,20), pady=(100, 15))