Spaces:
Sleeping
Sleeping
Commit
·
c3cf35f
1
Parent(s):
46148b2
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ def upload_file():
|
|
| 12 |
txt_file = request.files['txt_file']
|
| 13 |
|
| 14 |
# Считываем строки из загруженного файла TXT
|
| 15 |
-
lines = txt_file.read().decode().
|
| 16 |
|
| 17 |
# Создаем словарь в формате JSON
|
| 18 |
json_data = {str(index+1): line.strip() for index, line in enumerate(lines)}
|
|
|
|
| 12 |
txt_file = request.files['txt_file']
|
| 13 |
|
| 14 |
# Считываем строки из загруженного файла TXT
|
| 15 |
+
lines = txt_file.read().decode().splitlines()
|
| 16 |
|
| 17 |
# Создаем словарь в формате JSON
|
| 18 |
json_data = {str(index+1): line.strip() for index, line in enumerate(lines)}
|