2018年1月9日 星期二

Python: Get an absolute file path

Python: Get an absolute file path

Python Basic: Exercise-63 with Solution

Write a Python program to get an absolute file path.
Sample Solution:-
def absolute_file_path(path_fname):
        import os
        return os.path.abspath('path_fname')        
print("Absolute file path: ",absolute_file_path("test.txt"))

========== RESTART: F:/Python_APSC/py-ex-basic-63.py ===========
Absolute file path:  F:\Python_APSC\path_fname
>>> 

沒有留言:

張貼留言

2024產專班 作業2 (純模擬)

2024產專班 作業2  (純模擬) 1) LED ON,OFF,TIMER,FLASH 模擬 (switch 控制) 2)RFID卡號模擬 (buttom  模擬RFID UID(不從ESP32) 3) 使用database需先create建立資料庫 Node-Red 程式 [...