拼接文件路径 import os base_dir = os.path.dirname(__file__) # 获取当前文件目录 path = os.path.join(base_dir,'abc.txt') # 获取文件拼接后的路径