-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.py
More file actions
30 lines (21 loc) · 649 Bytes
/
app.py
File metadata and controls
30 lines (21 loc) · 649 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
import sys
from flask import Flask
app = Flask(__name__)
#Will pass errors to uwsgi for logging
app.config['PROPAGATE_EXCEPTIONS'] = True
@app.route('/')
def IOTest(): #Will read "Lorem Ipsum" to disk, and then write it back
lorem_ipsum = []
#Read Lorem from disk
f = open(sys.path[0]+"/lorem_ipsum_input.txt","r")
for line in f:
lorem_ipsum.append(line)
f.close()
#Write Lorem to disk
f = open(sys.path[0]+"/lorem_ipsum_output.txt","w")
for line in lorem_ipsum:
f.write(line)
f.close()
return "<p1>Lorem read and written to disk</p1>"
if __name__ == '__main__':
app.run()