from tkinter import *
import pandas as pd
def retrieve_input():
file = textBox.get("1.0","end-1c")
basefileread = pd.read_csv(str(textBox) + '.csv', encoding='latin-1')
basefilevalue = basefileread.loc[basefileread['Customer'].str.contains('Lam DepT', na=False),'Jun-18\nQty']
master = Tk()
master.geometry('200x100')
textBox = Text(master, height=2, width=10)
textBox.pack()
button1 = Button(master,text="Get Value", command=lambda: retrieve_input())
button1.pack()
master.mainloop()
print(int(textBox)+10)
I am trying to extract the information that I place into a textbox and run the following code, I want to specify which csv file I want the program to read, and find the value I specified from that file. I tried to hard code in textbox in my pandas reader and am just having trouble extraxting the string information that I type in the GUI and have that string appear so it can run my code. I am unsure if I am articulating my question correctly. And when I run this I get the error:
FileNotFoundError: File b'.!text.csv' does not exist
basefileread = pd.read_csv(file+'.csv', encoding='latin-1'). Also remember to add a print or something so you see the result.button1 = Button(master,text="Get Value", command=retrieve_input)