Python 文件操作

import os

// 文件是否存在
os.path.exists(filepath)

// 获取文件名
os.path.basename(filename)

// 获取文件大小
os.path.getsize(filepath)

// 连接文件名 ,
os.path.join(root, filename)

你可能感兴趣的:(Python 文件操作)