>>> import os >>> File="/1.ML/13.AllCombi/1.MakeFASTA/1.InputFile/PeakFiles.peak" >>> os.path.split(File) ('/1.ML/13.AllCombi/1.MakeFASTA/1.InputFile', 'PeakFiles.peak') >>> a = os.path.split(File) >>> a[0] '/1.ML/13.AllCombi/1.MakeFASTA/1.InputFile' >>> a[1] 'PeakFiles.peak'