Write a Python program to get an absolute file path

Write a Python program to get an absolute file path

1
2
3
4
def absolute_file_path(path_fname):
        import os
        return os.path.abspath('path_fname')        
print("Absolute file path: ",absolute_file_path("test.txt"))

Final output

Leave a Comment