Python ile Öğrenci Sistemi

# student note system - 1
import sqlite3
import sys
from tkinter import *
import time



while True:
    con = sqlite3.connect("trial.db")
    cursor = con.cursor()
    def createTable():
        cursor.execute("CREATE TABLE IF NOT EXISTS students(name TEXT,surname TEXT,number INT,students note INT)")


    def addStudents(name, surname, number, note):
        cursor.execute("INSERT INTO students VALUES('{} ','{}','{}','{}')".format(name, surname, number, note))
        con.commit()
        con.close()


    createTable()
    print("""
    
============================
(1) ADD STUDENT
(2) EXCEPT SYSTEM
    """)
    selection = input("selection(1,2) : ")
    if selection == "1":
        name = str(input("NAME    : "))
        surname = str(input("SURNAME : "))
        number = int(input("NUMBER  : "))
        note = int(input("NOTE    : "))
        addStudents(name, surname, number, note)
    elif selection == "2":
        sys.exit()

Leave a Reply