-
Notifications
You must be signed in to change notification settings - Fork 0
/
courses.py
62 lines (46 loc) · 2.4 KB
/
courses.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import sqlite3
class Courses:
def __init__(self, db_file):
self.con = sqlite3.connect(db_file)
self.cur = self.con.cursor()
if self.con:
print('Соединение с БД прошло успешно!')
def get_theway_python(self):
with self.con:
return self.cur.execute("SELECT description FROM 'courses' WHERE course_name='TheWayPython'").fetchone()
def get_theway_eng(self):
with self.con:
return self.cur.execute("SELECT description FROM 'courses' WHERE course_name='TheWayEnglish'").fetchone()
def get_theway_front(self):
with self.con:
return self.cur.execute("SELECT description FROM 'courses' WHERE course_name='TheWayFrontEnd'").fetchone()
def get_theway_uiux(self):
with self.con:
return self.cur.execute("SELECT description FROM 'courses' WHERE course_name='TheWayUIUX'").fetchone()
def get_theway_java(self):
with self.con:
return self.cur.execute("SELECT description FROM 'courses' WHERE course_name='TheWayJava'").fetchone()
def get_off_python(self):
with self.con:
return self.cur.execute("SELECT description FROM 'courses' WHERE course_name='OfflinePython'").fetchone()
def get_off_front(self):
with self.con:
return self.cur.execute("SELECT description FROM 'courses' WHERE course_name='OfflineFrontEnd'").fetchone()
def get_off_uiux(self):
with self.con:
return self.cur.execute("SELECT description FROM 'courses' WHERE course_name='OfflineUIUX'").fetchone()
def get_off_java(self):
with self.con:
return self.cur.execute("SELECT description FROM 'courses' WHERE course_name='OfflineJava'").fetchone()
def get_on_python(self):
with self.con:
return self.cur.execute("SELECT description FROM 'courses' WHERE course_name='OnlinePython'").fetchone()
def get_on_front(self):
with self.con:
return self.cur.execute("SELECT description FROM 'courses' WHERE course_name='OnlineFrontEnd'").fetchone()
def get_on_uiux(self):
with self.con:
return self.cur.execute("SELECT description FROM 'courses' WHERE course_name='OnlineUIUX'").fetchone()
def get_on_java(self):
with self.con:
return self.cur.execute("SELECT description FROM 'courses' WHERE course_name='OnlineJava'").fetchone()