to folder
This commit is contained in:
4
main.py
4
main.py
@@ -4,9 +4,9 @@ import json
|
|||||||
from colr import color
|
from colr import color
|
||||||
|
|
||||||
def on_message(ws, message):
|
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")
|
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:
|
with open(filename, "w") as file:
|
||||||
file.write(message)
|
file.write(message)
|
||||||
|
|||||||
Reference in New Issue
Block a user