to folder
This commit is contained in:
4
main.py
4
main.py
@@ -4,9 +4,9 @@ import json
|
||||
from colr import color
|
||||
|
||||
def on_message(ws, message):
|
||||
print("Data received! Writing it to a file")
|
||||
print("Data received!")
|
||||
timestamp = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
||||
filename = f"websocket_{timestamp}.dict"
|
||||
filename = f"data/websocket_{timestamp}.dict"
|
||||
|
||||
with open(filename, "w") as file:
|
||||
file.write(message)
|
||||
|
||||
Reference in New Issue
Block a user