Skip to content
KerwinKoo edited this page Dec 28, 2015 · 1 revision

文件名分解

python os.path.splitext 文件名分解

分解文件名的扩展名

fpathandname , fext = os.path.splitext( "你要分解的路径")

例如:

a, b = os.path.splitext( "c:\\123\\456\\test.txt" )

print a

print b

显示:

c:\123\456\test

.txt

[[TOC]]

Clone this wiki locally