import osp=os.path.dirname('C:\\win\\yes\\text.txt')print pprint os.path.split(p+"\\")#目录与文件分离print os.path.split(p)print os.path.dirname(p)#the first half of the pair returned by split(path).print os.path.basename(p)#the second half of the pair returned by split(path).print os.pat Read More
posted @ 2013-01-06 10:12 godjob Views(270) Comments(0) Diggs(0) Edit