utility class added

자료 저장 구조 고민중...
This commit is contained in:
2024-04-08 01:33:15 +09:00
parent 809748a73a
commit cc02151899
6 changed files with 217 additions and 61 deletions

39
UtilPack.py Normal file
View File

@@ -0,0 +1,39 @@
import os
import time
m_dbgLevel = 0
listDbgStr = []
#
def IsEmptyStr(string):
return 0 == len(string.strip())
#
def GetCurrentTime():
# 현재 시간을 구하고 구조체로 변환
current_time_struct = time.localtime()
# 구조체에서 연, 월, 일, 시간, 분, 초를 추출
year = current_time_struct.tm_year
month = current_time_struct.tm_mon
day = current_time_struct.tm_mday
hour = current_time_struct.tm_hour
minute = current_time_struct.tm_min
second = current_time_struct.tm_sec
strRet = (f"{year}/{month}/{day}_{hour}:{minute}:{second}")
return strRet
#for debug
def DbgOut(str):
strMsg = GetCurrentTime() +" : " + str
listDbgStr.append(strMsg)
print(strMsg)
def printDbgMessages():
for line in listDbgStr:
print(line)