-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
52 lines (45 loc) · 1.63 KB
/
app.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
'''
Main function which provides the interface for the firs and the last page of the application.
'''
import time
from pywebio import STATIC_PATH
from pywebio.input import *
from pywebio.output import *
from pywebio import STATIC_PATH
import argparse
from pywebio import start_server, session
from menu import Menu
mymenu = Menu() # obj of class Menu
def run_app():
#opening page interface
img1 = open('welcome.png', 'rb').read()
style(put_image(img1, width='100%'),'display: block; margin-left: auto; margin-right: auto;')
put_processbar('bar')
for i in range(1, 11):
set_processbar('bar', i / 10)
time.sleep(0.8)
time.sleep(2)
clear()
mymenu.user=None
#Displays Main Menu, program works till choice is not 4(log out)
while(mymenu.user != 4):
img2 = open('college.png', 'rb').read()
style(put_image(img2, width='100%'), 'display: block; margin-left: auto; margin-right: auto;')
mymenu.login()
if mymenu.user == 2:
clear()
mymenu.menu_for_student()
elif mymenu.user == 3:
clear()
mymenu.menu_for_admin()
clear()
#closing page interface
img = open('goodbye.png', 'rb').read()
style(put_image(img, width='80%'),'display: block; margin-left: auto; margin-right: auto;')
time.sleep(10)
clear()
if __name__== '__main__':
parser= argparse.ArgumentParser()
parser.add_argument("-p", "--port", type=int, default=8080)
args= parser.parse_args()
start_server(run_app, port= args.port, websocket_ping_interval= 60)