Relative Content

Tag Archive for pythonsqlitetkintererror-handlingcustomtkinter

Why doesnt the programm insert the data that i type in?

import sqlite3 import re from tkinter import messagebox onlyNumber = r’^d+$’ onlyLetters = r’^[a-zA-Zs]+$’ onlyAge = r’^d+$’ def insertStudent(student_id, full_name, age): if re.match(onlyNumber, student_id) and re.match(onlyLetters, full_name) and re.match(onlyAge, age): try: with sqlite3.connect(‘school.sqlite’) as conn: cursor = conn.cursor() cursor.execute(“INSERT INTO student (StudentID, FullName, Age) VALUES (?, ?, ?)”, (student_id, full_name, age)) conn.commit() messagebox.showinfo(“Success”, “Student successfully […]