awacke1 commited on
Commit
eca48c8
·
1 Parent(s): 1c7d5a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -18,7 +18,8 @@ def main():
18
  st.text("Message sent!")
19
 
20
  st.text("Chat history:")
21
- with open("chat.txt", "r") as f:
 
22
  chat_history = f.read()
23
  st.text(chat_history)
24
 
@@ -31,7 +32,8 @@ def main():
31
  t -= 1
32
  if t == 0:
33
  countdown.text("Time's up!")
34
- with open("chat.txt", "r") as f:
 
35
  chat_history = f.read()
36
  st.text(chat_history)
37
  t = 60
 
18
  st.text("Message sent!")
19
 
20
  st.text("Chat history:")
21
+ with open("chat.txt", "a+") as f:
22
+ f.seek(0)
23
  chat_history = f.read()
24
  st.text(chat_history)
25
 
 
32
  t -= 1
33
  if t == 0:
34
  countdown.text("Time's up!")
35
+ with open("chat.txt", "a+") as f:
36
+ f.seek(0)
37
  chat_history = f.read()
38
  st.text(chat_history)
39
  t = 60