import os
file_path = "D:/test/test.py"
(filepath,tempfilename) = os.path.split(file_path)
(filename,extension) = os.path.splitext(tempfilename)
其中:
filepath为文件的目录,即
D:/test
filename为文件的名字,即
test
extension为文件的扩展名,即
.py
2024-02-24 16:34:16
import os
file_path = "D:/test/test.py"
(filepath,tempfilename) = os.path.split(file_path)
(filename,extension) = os.path.splitext(tempfilename)
其中:
filepath为文件的目录,即D:/test
filename为文件的名字,即test
extension为文件的扩展名,即.py
下一篇:app的meta