Code:
import os FilePath = "/a/bb/ccc/dddd.png" FolderPath, FullFileName = os.path.split(FilePath) Name, Suffix = os.path.splitext(FullFileName) print("文件路径: {}\n文件全名: {}\n文件名: {}\n文件后缀: {}".format(FolderPath, FullFileName, Name, Suffix))
Result:
标签:文件,FullFileName,文件名,Python,路径,全名,os From: https://www.cnblogs.com/XZyoung/p/17359355.html