how to get current filename in python code example
Example 1: python get current file location
import os
os.path.dirname(os.path.abspath(__file__))
Example 2: python name of current file
from pathlib import Path
print(Path(__file__).stem) #myfile
print(Path(__file__).name) #myfile.py