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
>>>
沒有留言:
張貼留言