Python 文件操作

2021-04-23  本文已影响0人  领导的玩具

import os

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

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

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

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

上一篇 下一篇

猜你喜欢

热点阅读