awacke1 commited on
Commit
698d115
1 Parent(s): 7aa681f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -45,8 +45,7 @@ def store_message(name: str, message: str, outputfileName: str):
45
  with open(savePath, "w") as f: #write
46
  f.write(str("time, message, text\n")) # one time only to get column headers for CSV file
47
  if name and message:
48
- with open(savePath, "a") as csvfile:
49
- writer = csv.DictWriter(csvfile, fieldnames=[ "time", "message", "name", ])
50
  writer.writerow(
51
  {"time": str(datetime.now()), "message": message.strip(), "name": name.strip() }
52
  )
 
45
  with open(savePath, "w") as f: #write
46
  f.write(str("time, message, text\n")) # one time only to get column headers for CSV file
47
  if name and message:
48
+ writer = csv.DictWriter(f, fieldnames=["time", "message", "name"])
 
49
  writer.writerow(
50
  {"time": str(datetime.now()), "message": message.strip(), "name": name.strip() }
51
  )