Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python extract thefile name from relative path

import os
infile = "./../../../../_data/matrix_data/5mer_normalized.tsv"
print(os.path.basename(infile))
>>> "5mer_normalized.tsv"
 
PREVIOUS NEXT
Tagged: #python #extract #thefile #relative #path
ADD COMMENT
Topic
Name
2+4 =