ciyidogan commited on
Commit
302fbfe
·
verified ·
1 Parent(s): fc87357

Create utils.py

Browse files
Files changed (1) hide show
  1. utils.py +12 -0
utils.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import sys
3
+ from datetime import datetime
4
+
5
+ def log(message):
6
+ timestamp = datetime.now().strftime("%H:%M:%S")
7
+ print(f"[{timestamp}] {message}")
8
+ sys.stdout.flush()
9
+
10
+ def save_service_config(config):
11
+ with open("service_config.json", "w") as f:
12
+ json.dump(config.data, f, indent=2)