Update app.py
Browse files
app.py
CHANGED
|
@@ -121,12 +121,10 @@ def talk(prompt, history):
|
|
| 121 |
# write data to file
|
| 122 |
with open("./file.txt", "a") as data:
|
| 123 |
data.write(historylog)
|
| 124 |
-
data = open("./file.txt", "r")
|
| 125 |
-
data.seek(0)
|
| 126 |
# Read the contents of the file to display it.
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
|
| 131 |
except IOError as e:
|
| 132 |
print(f"An error occurred: {e}")
|
|
|
|
| 121 |
# write data to file
|
| 122 |
with open("./file.txt", "a") as data:
|
| 123 |
data.write(historylog)
|
|
|
|
|
|
|
| 124 |
# Read the contents of the file to display it.
|
| 125 |
+
print("History log printed:")
|
| 126 |
+
with open("./file.txt", "r") as data:
|
| 127 |
+
print(data.read())
|
| 128 |
|
| 129 |
except IOError as e:
|
| 130 |
print(f"An error occurred: {e}")
|