python-os模块拆分文件路径和文件名
import os file_path = "/var/www/project/logs/projectpom.log" (filepath,tempfilename) = os.path.split(file_path) (filename,extension) = os.path.splitext(tempfilename) print("文件路径 ",filepath) print("文件名(全) ",tempfilename) print("文件名 ",filename) print("文件后缀 ",extension)
python 中文名:蟒蛇,设计者:Guido van Rossum