Write a Python program to retrieve the path and name of the file currently being executed

Write a Python program to retrieve the path and name of the file currently being executed

1
2
import os
print("Current File Name : ",os.path.realpath(__file__))

Final output

Leave a Comment