Skip to content

Commit 75a9b59

Browse files
committed
tkinter
1 parent 51cac93 commit 75a9b59

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+11437
-360
lines changed

Basic_Python/cel_to_far.py

-8
This file was deleted.

Basic_Python/file.py

-6
This file was deleted.

Basic_Python/fruits.txt

-6
This file was deleted.

Basic_Python/one.py

-15
This file was deleted.

Basic_Python/two.py

-9
This file was deleted.

Beyond_Basics/.vscode/settings.json

-3
This file was deleted.

Beyond_Basics/2018-04-16-00-52-54-888865.txt

-19
This file was deleted.

Beyond_Basics/cel_to_far_in_file.py

-18
This file was deleted.

Beyond_Basics/date_time.py

-12
This file was deleted.

Beyond_Basics/exceptions.py

-8
This file was deleted.

Beyond_Basics/file.txt

-3
This file was deleted.

Beyond_Basics/file1.txt

-1
This file was deleted.

Beyond_Basics/file2.txt

-1
This file was deleted.

Beyond_Basics/file3.txt

-1
This file was deleted.

Beyond_Basics/merging_files.py

-11
This file was deleted.

Beyond_Basics/password_checker.py

Whitespace-only changes.

Beyond_Basics/temp.txt

-9
This file was deleted.

Project4-Flask/script.py

-14
This file was deleted.

Project4-Flask/static/css/main.css

-90
This file was deleted.

Project4-Flask/templates/about.html

-7
This file was deleted.

Project4-Flask/templates/homepage.html

-7
This file was deleted.

Project4-Flask/templates/layout.html

-24
This file was deleted.
Binary file not shown.
Binary file not shown.

Project5-Tkinter-GUI/backend.py

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
"""
4+
Created on Tue May 1 11:34:57 2018
5+
6+
@author: iknownothing
7+
"""
8+
9+
import sqlite3,sys
10+
11+
12+
def create():
13+
db=sqlite3.connect("book.db")
14+
cur=db.cursor()
15+
cur.execute("CREATE TABLE IF NOT EXISTS books(id INTEGER PRIMARY KEY,title TEXT,year INTEGER,author TEXT,isbn INTEGER)")
16+
db.commit()
17+
db.close()
18+
print('Successfull')
19+
20+
21+
def insert(title,year,author,isbn):
22+
create()
23+
db=sqlite3.connect("book.db")
24+
cur=db.cursor()
25+
cur.execute("INSERT INTO books VALUES(NULL,?,?,?,?)",(title,year,author,isbn))
26+
db.commit()
27+
db.close()
28+
viewAll()
29+
30+
def update(id,title,year,author,isbn):
31+
create()
32+
db=sqlite3.connect("book.db")
33+
cur=db.cursor()
34+
cur.execute("UPDATE books SET title=?,year=?,author=?,isbn=? WHERE id=?",(title,year,author,isbn,id))
35+
db.commit()
36+
db.close()
37+
38+
39+
def viewAll():
40+
create()
41+
db=sqlite3.connect("book.db")
42+
cur=db.cursor()
43+
cur.execute("SELECT * FROM books")
44+
rows=cur.fetchall()
45+
db.close()
46+
print(rows)
47+
return rows
48+
49+
def delete(id):
50+
create()
51+
db=sqlite3.connect("book.db")
52+
cur=db.cursor()
53+
cur.execute("DELETE FROM books WHERE id=?",(id,))
54+
db.commit()
55+
db.close()
56+
57+
58+
def searchEntry(title="",year="",author="",isbn=""):
59+
create()
60+
db=sqlite3.connect("book.db")
61+
cur=db.cursor()
62+
cur.execute("SELECT * FROM books WHERE title=? OR year=? OR author=? OR isbn=?",(title,year,author,isbn))
63+
rows=cur.fetchall()
64+
db.close()
65+
return rows
66+
67+
def exit():
68+
sys.exit(1)
69+

Project5-Tkinter-GUI/book.db

8 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)