os.path.join() - 忽略绝对路径前的参数
os.path.join()会忽略第一个绝对路径之前的参数!
示例:
>>> import os >>> os.path.join('/home', 'mushroomer') '/home/mushroomer' >>> os.path.join('/home', '/mushroomer') '/mushroomer' >>> os.path.join('/home', './mushroomer') '/home/./mushroomer'
参考资料:https://docs.python.org/3.7/library/os.path.html?#module-os.path
Perfection is achieved not when there is nothing more to add, but rather when there is nothing more to take away.
-- Antoine de Saint-Exupéry