Update UI.py, UtilPack.py, and ui_Tki.py
This commit is contained in:
13
UtilPack.py
13
UtilPack.py
@@ -13,10 +13,12 @@ from pathlib import Path
|
||||
m_dbgLevel = 0
|
||||
listDbgStr = []
|
||||
|
||||
|
||||
#
|
||||
def IsEmptyStr(string):
|
||||
return 0 == len(string.strip())
|
||||
|
||||
|
||||
#
|
||||
def GetCurrentTime():
|
||||
# 현재 시간을 구하고 구조체로 변환
|
||||
@@ -34,6 +36,7 @@ def GetCurrentTime():
|
||||
|
||||
return strRet
|
||||
|
||||
|
||||
#for debug
|
||||
def DbgOut(strInput, bPrint = False):
|
||||
strMsg = (f"{GetCurrentTime()} : {strInput}")
|
||||
@@ -63,6 +66,7 @@ def ListSubDirectories(root_dir):
|
||||
|
||||
return subdirectories
|
||||
|
||||
|
||||
# 자식 폴더를 구해온다. 직계 자식만
|
||||
def ListChildDirectories(pathDir):
|
||||
listRet = []
|
||||
@@ -73,6 +77,7 @@ def ListChildDirectories(pathDir):
|
||||
|
||||
return listRet
|
||||
|
||||
|
||||
# 파일목록만 구해온다. 자식 폴더에 있는건 무시.
|
||||
def ListContainFiles(pathDir):
|
||||
listRet = []
|
||||
@@ -83,6 +88,7 @@ def ListContainFiles(pathDir):
|
||||
|
||||
return listRet
|
||||
|
||||
|
||||
def ListFileExtRcr(pathTrg, listExt):
|
||||
listRet= []
|
||||
|
||||
@@ -128,6 +134,7 @@ def IsFinalFolder(path):
|
||||
|
||||
return bRet;
|
||||
|
||||
|
||||
# 어떤 경로 안에서 특정 확장자의 파일을 뽑아내어 그 리스트를 반환한다.
|
||||
def FindFileFromExt(path, ext):
|
||||
bDot = False
|
||||
@@ -148,7 +155,8 @@ def FindFileFromExt(path, ext):
|
||||
listRet.append(item)
|
||||
|
||||
return listRet
|
||||
|
||||
|
||||
|
||||
# 파일 이름에서 확장자를 뽑아낸다. True : '.' 을 포함한다.
|
||||
def GetExtStr(file_path, bDot = True):
|
||||
retStr = ""
|
||||
@@ -164,6 +172,7 @@ def GetExtStr(file_path, bDot = True):
|
||||
|
||||
return retStr
|
||||
|
||||
|
||||
# 문자열에 포함된 단어를 지운다.
|
||||
def RmvSubString(mainString, subString):
|
||||
# 문자열에서 부분 문자열의 인덱스를 찾습니다.
|
||||
@@ -176,10 +185,12 @@ def RmvSubString(mainString, subString):
|
||||
# 부분 문자열을 제거하고 새로운 문자열을 반환합니다.
|
||||
return mainString[:strIdx] + mainString[endIdx:]
|
||||
|
||||
|
||||
def ExtractZIP(zip_file, extract_to):
|
||||
with zipfile.ZipFile(zip_file, 'r') as zf:
|
||||
zf.extractall(extract_to)
|
||||
|
||||
|
||||
#
|
||||
def CreateZIP(output_zip, *files):
|
||||
with zipfile.ZipFile(output_zip, 'w') as zf:
|
||||
|
||||
Reference in New Issue
Block a user