# 创建路径
def mkdir(path):
if not os.path.exists(path):
os.makedirs(path)
# 查文件列表
os.listdir(path)
path = './'
# 判断路径是否存在
os.path.exists(path) # True
# 路径拼接
os.path.join(path, 'test/test') # ./test/test
# 获取文件夹名
os.path.dirname(path)
# 创建路径
def mkdir(path):
if not os.path.exists(path):
os.makedirs(path)
# 查文件列表
os.listdir(path)
path = './'
# 判断路径是否存在
os.path.exists(path) # True
# 路径拼接
os.path.join(path, 'test/test') # ./test/test
# 获取文件夹名
os.path.dirname(path)