#########start 获取文件路径、文件名、后缀名############ from gevent import os def jwkj_get_filePath_fileName_fileExt(filename): (filepath,tempfilename) = os.path.split(filename); (shotname,extension) = os.path.splitext(tempfilename); return filepath,shotname,extension #########end 获取文件路径、文件名、后缀名############ print(jwkj_get_filePath_fileName_fileExt("D:/保存的图片/571711894929.png"))
输出结果:(‘D:/保存的图片‘, ‘571711894929‘, ‘.png‘)
原文地址:https://www.cnblogs.com/zhangdingqu/p/9543937.html
时间: 2024-10-12 16:45:22