Given a relative path, such as "mydir/myfile.txt"
"C:/example/cwd/mydir/myfile.txt"
Like this
How do I find the absolute path?
The function that receives the path and returns the absolute path is os.path" in the os module.absppath(path).
import os
os.path.abspath("mydir/myfile.txt")
© 2024 OneMinuteCode. All rights reserved.