Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,17 +31,17 @@ def list_attributes_and_values():
|
|
| 31 |
|
| 32 |
def append_text_to_file(text):
|
| 33 |
file_path = 'text_file.txt'
|
| 34 |
-
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
|
| 44 |
-
return
|
| 45 |
|
| 46 |
|
| 47 |
def load_html():
|
|
|
|
| 31 |
|
| 32 |
def append_text_to_file(text):
|
| 33 |
file_path = 'text_file.txt'
|
| 34 |
+
zip_file_path = 'text_file.zip'
|
| 35 |
|
| 36 |
+
with open(file_path, 'a') as file:
|
| 37 |
+
file.write(text + '\n')
|
| 38 |
+
with open(file_path, 'r') as file:
|
| 39 |
+
new_content = file.read()
|
| 40 |
+
print(new_content)
|
| 41 |
+
with zipfile.ZipFile(zip_file_path, 'w') as zipf:
|
| 42 |
+
zipf.write(file_path, os.path.basename(file_path))
|
| 43 |
|
| 44 |
+
return zip_file_path
|
| 45 |
|
| 46 |
|
| 47 |
def load_html():
|