-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtools.py
More file actions
29 lines (22 loc) · 758 Bytes
/
tools.py
File metadata and controls
29 lines (22 loc) · 758 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
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
with open('tools/Dockerfile','r') as f:
for line in f:
if "dnf install" in line:
toolslist = line.split(' ')
data_list = toolslist[3:][:-4]
meta_linux = "1、已经安装的工具列表如下:\n"
str_tools = meta_linux + '\n'.join(data_list)
meta_python3 = "\n\n\n2、python3.8的第三方库如下:\n"
pip_list = []
with open('tools/requirements.txt','r') as f:
for line in f:
pip_list.append(line)
str_tools = str_tools + meta_python3 + ''.join(pip_list)
print(str_tools)
return str_tools
index()
if __name__ == '__main__':
app.run(host="0.0.0.0", port=80, debug=False)