for i in range(len(files)):
print("ok")
if files[i] == images[i] :
output_dir =labels[i]
output_dir_path = output_dir
if not os.path.exists("./output_dir_path"):
os.makedirs(output_dir_path)
print("ok")
我这种方法没办法在路径中引用变量,请问有办法解决这个问题么?

python,在路径中引用变量的方法?请教
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
12条回答 默认 最新
- threenewbee 2018-05-17 11:04关注
if not os.path.exists("./output_dir_path" + 变量 + ".txt"):
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报