2018年1月8日 星期一

Python: Get the path and name of the file that is currently executing

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
>>> 

沒有留言:

張貼留言

Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --3

  Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --3 AngularJS 實例 <!DOCTYPE html> <html> <head> <meta charse...