-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.py
More file actions
34 lines (26 loc) · 655 Bytes
/
init.py
File metadata and controls
34 lines (26 loc) · 655 Bytes
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
import os
import sys
import flask
import _thread
firstOpen = None
webapp = flask.Flask('VisualASM - WebAPP')
@webapp.route('/')
def index():
return {'code':200}
@webapp.route('/api/v1/fristopen')
def ifFristOpen():
return {'code':200,'result':firstOpen}
def main():
global firstOpen
try:
with open('fristopen','r') as f:
f = f
firstOpen = False
except FileNotFoundError:
firstOpen = True
with open('fristopen','w') as f:
f.write('200')
webapp.run(port=2333,host='0.0.0.0')
if __name__ == '__main__':
_thread.start_new(main, ())
os.system('python main.py')