提交 b63a1888 编写于 作者: 片刻小哥哥's avatar 片刻小哥哥

create_path2dir 添加创建文件路径的方法

上级 adac2583
......@@ -88,6 +88,21 @@ def get_dir_files(dir, filelist=[], status=0, str1=""):
return sorted(filelist, reverse=False)
def create_path2dir(filename):
"""
:desc: 创建文件路径的方法
:param:
filename 文件的路径
:return:
"""
file_dir = os.path.dirname(filename)
print(file_dir)
if os.path.exists(file_dir):
pass
else:
os.makedirs(file_dir)
# if __name__ == "__main__":
# print(getFileSize("../detailhtml/20161103112313.html"))
# # 1006.142578kb
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册