Python: Get the path and name of the file that is currently executing
Python Basic: Exercise-46 with Solution
Write a python program to get the path and name of the file that is currently executing.
Sample Solution:-
import os
print("Current File Name : ",os.path.realpath(__file__))
========== RESTART: F:/Python_APSC/py-ex-basic-46.py ==========
Current File Name : F:\Python_APSC\py-ex-basic-46.py
>>>
沒有留言:
張貼留言