Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset
Comments Off

Fonction de découpage des chemins des fichiers


{filelink=16416}

 
import os, time
 
path= 'c:/test.txt'
 
print os.path.basename(path)       #test.txt
 
print os.path.dirname(path)        # C:
 
print os.path.split(path)          #('c:/', 'test.txt')
 
print os.path.splitdrive(path)     # ('c:', '/test.txt')
 
# Extension
print os.path.splitext(path)       # ('c:/test', '.txt')
 
print os.path.abspath(path)        # c:test.txt

Livres Sur ce Sujet

----------------------------------------------------------------------------

Comments are closed.