1. Python字符串转十六进制数
hexStr = "0x123AF"
hexNum = int(hexStr,16)
2. Python处理 <文件||文件夹>
def deal_command(env, engine, path):
global g_bContinue
bContinue = True
if False == os.path.isdir(path):
bContinue = deal_single_file(env, engine, path)
else:
dirpath = path
for root, dirs, files in os.walk(dirpath):
for filename in files:
filepath = os.path.join(root, filename)
bContinue = deal_single_file(env, engine, filepath)
if False == bContinue:
return bContinue
if False == g_bContinue:
return g_bContinue
return bContinue