Skip to content

Commit

Permalink
Update listener.py
Browse files Browse the repository at this point in the history
converted ' to "
  • Loading branch information
maviterlikli authored Oct 11, 2024
1 parent 6664dcf commit 91fbfb8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
def on_message(ws: Any, message: str):
message_dict = json.loads(message)
data = message_dict["data"]
data = json.dumps(data)
print(data)
with open("log.txt", "a") as myfile:
myfile.write(str(data))
myfile.write("\n")

def on_error(ws: Any, message: str):
message = json.dumps(message)
print(message)
with open("error.txt", "a") as myfile:
myfile.write(str(message))
Expand Down

0 comments on commit 91fbfb8

Please sign in to comment.