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

沒有留言:

張貼留言

2026-09 mqtt 實驗3

 2026-09 mqtt 實驗3 node-red參考網址 https://sites.google.com/gm.lhu.edu.tw/charlesho/service/aiot?pli=1&authuser=0#h.m7oahj9kmy1d Node-RED入門課...