👍️[Update] Model : status 348のlog を printLog関数に集約
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from typing import Any
|
||||
import json
|
||||
import random
|
||||
from typing import Union
|
||||
from os import path as os_path, rename as os_rename
|
||||
@@ -69,4 +71,15 @@ def splitList(lst:list, split_count:int, to_shuffle:bool=False):
|
||||
for i in range(0, len(lst), split_count):
|
||||
sub_list = lst[i:i+split_count]
|
||||
split_lists.append(sub_list)
|
||||
return split_lists
|
||||
return split_lists
|
||||
|
||||
def encodeUtf8(data:str) -> dict:
|
||||
data = {i: byte for i, byte in enumerate(data.encode('UTF-8'))}
|
||||
return data
|
||||
|
||||
def decodeUtf8(data:dict) -> str:
|
||||
data = bytes(data.values()).decode("UTF-8")
|
||||
return data
|
||||
|
||||
def printLog(log:str, data:Any=None) -> None:
|
||||
print(json.dumps({"status":348, "log":log, "data":str(data)}), flush=True)
|
||||
Reference in New Issue
Block a user