Python code doesn’t format data correctly when writing to csv file, spreads it over multiple lines instead of all on one line
def SaveToCsv(subject, question, answer, questiontype): with open(r”BankOfQuestions.csv”, “a”, newline=”, encoding=’utf-8′) as Bank: writer = csv.writer(Bank, delimiter=’,’) writer.writerow([question, answer, questiontype, subject]) def AddNewQuestion(subject): window = tk.Toplevel(root) window.title(f”Add a new question for {subject}”) if subject == “New Subject”: Label1 = tk.Label(window, text=”Enter name of subject”) Label1.pack() SubjectTitle = tk.StringVar() NameOfSubject = tk.Entry(window, textvariable=SubjectTitle, font=(“Ariel”, 10)) NameOfSubject.pack() Label2= […]
Taking Values from tkinter input boxes to be used as input variables in another function
I am currently working on building a data analysis program for my research, and just trying to make it more user-friendly for the undergrads in my lab.