## 转换c/cpp文件为txt后缀名(手机browser阅读)的html列表
import os,sys,re
import shutil,string
def getList(dirname,pFunc):
try:
ls=os.listdir(dirname)
except:
print dirname,'is access deny'
else:
for file in ls:
temp = os.path.join(dirname,file)
if(os.path.isdir(temp)):
getList(temp,pFunc)
else:
pFunc(dirname,file)
#[OK]
def getType(fname):
pos = fname.rfind(".")
if pos != -1:
return fname[pos + 1:]
return ""
def printCppFile(dirname,file):
if file == "dev.py" or file == "index.html":
return
m_type = getType(file)
newFile = "%s.txt" % ( file.replace(".","_"))
if m_type != "txt":
oldName = os.path.join(dirname,file)
newName = os.path.join(dirname,ne