标签:
import os.path
spath="D:/360Downloads/testFile1/folder2/testFile1.txt"
#case 1:
p,f=os.path.split(spath);
print("dir is:" + p)
print("file is:" + f)
#case 2:
drv,left=os.path.splitdrive(spath);
print("drive is:" + drv)
print("left is:" + left)
#case 3:
f,ext = os.path.splitext(spath);
print("f is:" + f)
print("ext is:" + ext)
标签:
原文地址:http://www.cnblogs.com/ametuer/p/5066260.html