os模块在当前目录创建文件夹和文件

import os
if not os.path.isdir("result"):
    os.mkdir("result")
if not os.path.isdir("result/tf"):
    os.mkdir("result/tf")

a = open("result/tf/video.html", "a", encoding="utf-8")
b = a.write("html")
a.close()

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/liaoqingjian/article/details/108888727
今日推荐