分离路径、文件名
org_path = r"F:\temp\test" fpath, fname = os.path.split(org_path) print(fpath,fname) # F:\temp test
拼接路径
org_path = r"F:\temp\test" for f in os.listdir(org_path): f_path = os.path.join(org_path,f) print(f_path) # F:\temp\test\test1 # F:\temp\test\test2