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
Apprendre à programmer avec Python 3 Apprenez à programmer en Python Python : Petit guide à l’usage du développeur agile Apprendre à programmer avec Python 3 : Avec plus de 50 pages de corigés d’exercices !