-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathData.py
executable file
·59 lines (37 loc) · 1.16 KB
/
Data.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
import Niram_data as data
DATA=data.DATA
def Get_Branch_List():
return list(DATA.keys())
def Get_Branch_Semester_Data(Branch):
if Branch in DATA:
return DATA[Branch]
else:
raise RuntimeError('Branch not found')
def Get_Branch_Semester_List(Branch='Chemical Engineering-BCH'):
return list(DATA[Branch].keys())
def Get_Branch_Semester_Sub_List(Branch,Semester):
list=Get_Branch_Semester_Data(Branch)
# print(list)
if Semester in list:
l_data= list[Semester]
data=[]
for i in range(len(l_data)):
data.append(l_data[i].copy());
data[i].append(data[i][1].split("|")[1:])
data[i][1]=data[i][1].split("|")[0]
# print(list[Semester])
# print(data)
return data
else:
raise RuntimeError('Semester not found')
def Get_Branch_Semester_Sub_List_SPI(Branch,Semester):
list=Get_Branch_Semester_Data(Branch)
# print(list)
if Semester in list:
data=list[Semester]
# print(data)
return data
else:
raise RuntimeError('Semester not found')
if __name__=="__main__":
print(Get_Branch_List())