how to current file name in python code example
Example 1: python name of current file
from pathlib import Path
print(Path(__file__).stem) #myfile
print(Path(__file__).name) #myfile.py
Example 2: python find file name
filesName = list(map(os.path.basename, glob.glob("..\yourPath\*txt")))
print(filesName)