os.path.join os.path.join('a/b/c', '/d/e/f') return /d/e/f os.path.join('a/b/c', 'd/e/f') return a/b/c/d/e/f 实际测试 a = os.path.join('a/b/c', '/d/e/f') print(a) b = os.path.join('a/b/c', 'd/e/f') print(b) 结果