-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
64 lines (45 loc) · 1.23 KB
/
main.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
from flask import Flask, render_template, url_for, redirect
from cli import *
import time
import webbrowser
import threading
app = Flask(__name__)
emotionVAl=val()
sys.path.insert(1, './src/')
# emotionVAl=[1,1,1,1,0]
@app.route('/')
def upload_file():
return render_template('index.html', log=emotionVAl)
progressMeter = "[#######"
completionMeter = "[###################################################" # 51
for i in range(100):
if (i == 1 or i == 10 or i == 30):
time.sleep(0.6)
print('\r'+progressMeter, end='')
time.sleep(0.15)
if(i == 25):
time.sleep(1.5)
progressMeter += '#'
if progressMeter == completionMeter:
break
print(']')
def appRUN():
print("opening server .....")
progressMeter = "[#######"
completionMeter = "[#####################" # 51
for i in range(100):
print('\r'+progressMeter, end='')
time.sleep(0.2)
progressMeter += '#'
if progressMeter == completionMeter:
break
app.run()
def openWindow():
time.sleep(5)
webbrowser.open_new('http://127.0.0.1:5000/')
t1 = threading.Thread(target=appRUN)
# t2 = threading.Thread(target=openWindow)
t1.start()
# t2.start()
t1.join()
# t2.join()