Jul 232012
How to get absolute path in Python?
Answer:
To return the absolute path when you provide shortcut path such as ".", e.g.
import os
print os.path.abspath(".") # print the full path of ., depending where you execute the program
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to get absolute path in Python?
Answer:
To return the absolute path when you provide shortcut path such as ".", e.g.
import os
print os.path.abspath(".") # print the full path of ., depending where you execute the program