Spaces:
Sleeping
Sleeping
DmitrMakeev
commited on
Commit
·
a5676a7
1
Parent(s):
c3cf35f
Update app.py
Browse files
app.py
CHANGED
@@ -17,9 +17,9 @@ def upload_file():
|
|
17 |
# Создаем словарь в формате JSON
|
18 |
json_data = {str(index+1): line.strip() for index, line in enumerate(lines)}
|
19 |
|
20 |
-
# Записываем данные в файл JSON
|
21 |
with open('output.json', 'w') as json_file:
|
22 |
-
json.dump(json_data, json_file)
|
23 |
|
24 |
return render_template('index.html', json_data=json_data)
|
25 |
|
|
|
17 |
# Создаем словарь в формате JSON
|
18 |
json_data = {str(index+1): line.strip() for index, line in enumerate(lines)}
|
19 |
|
20 |
+
# Записываем данные в файл JSON с отступами и переносами строк
|
21 |
with open('output.json', 'w') as json_file:
|
22 |
+
json.dump(json_data, json_file, indent=4)
|
23 |
|
24 |
return render_template('index.html', json_data=json_data)
|
25 |
|