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
原文地址:https://www.cnblogs.com/adjwang/p/12237173.html
时间: 2024-10-08 13:28:03