How to check if a path is absolute path or relative path in cross platform way with Python? -
unix absolute path starts '/', whereas windows starts alphabet 'c:' or '\'. python has standard function check if path absolute or relative?
os.path.isabs
returns true
if path absolute, false
if not. the documentation says works in windows (i can confirm works in linux personally).
os.path.isabs(my_path)
Comments
Post a Comment