Answers for "python get only file name"

5

get current file name python

import os
os.path.basename(__file__)
Posted by: Guest on July-18-2021
1

python find file name

filesName = list(map(os.path.basename, glob.glob("..\yourPath\*txt")))
print(filesName)
Posted by: Guest on January-31-2021

Code answers related to "python get only file name"

Python Answers by Framework

Browse Popular Code Answers by Language