Answers for "check part of the name file directory python"

9

get directory of file python

import os 
dir_path = os.path.dirname(os.path.realpath(__file__))
Posted by: Guest on April-03-2020
0

python get file name without dir

>>> os.path.basename('/path_name/1.log,/path_name/2.log')
'2.log'
Posted by: Guest on October-18-2021

Code answers related to "check part of the name file directory python"

Python Answers by Framework

Browse Popular Code Answers by Language