· 7 years ago · Oct 04, 2018, 05:08 AM
1# student note system - 1
2import sqlite3
3import sys
4from tkinter import *
5import time
6
7
8
9while True:
10 con = sqlite3.connect (" trial.db ")
11 cursor = con.cursor ()
12 def createTable ():
13 cursor.execute ("CREATE TABLE IF NOT EXISTS students (name TEXT, TEXT, number INT, students note INT)")
14
15
16 def addStudents (name, surname, number, note):
17 cursor.execute ("INSERT INTO students VALUES ('{}', '{}', '{}', '{}')". format (name, surname, number, note))
18 con.commit ()
19 con.close ()
20
21
22 CreateTable ()
23 print ( "" "
24
25============================
26(1) ADD STUDENT
27(2) EXCEPT SYSTEM
28 "" ")
29 selection = input ("selection (1,2):")
30 if selection == "1":
31 name = str (input ("NAME:"))
32 s = str (input ("SURNAME:"))
33 number = int (input ("NUMBER:"))
34 note = int (input ("NOTE:"))
35 addStudents (name, surname, number, note)
36 elif selection == "2":
37 sys.exit ()