os.path.abspath('file1.txt') doesn't return the correct path

后端 未结 5 1607
被撕碎了的回忆
被撕碎了的回忆 2020-12-18 07:49

Say the path of the file \'file1.txt\' is /home/bentley4/Desktop/sc/file1.txt Say my current working directory is /home/bentley4

i         


        
5条回答
  •  無奈伤痛
    2020-12-18 08:41

    I was working on the same issue and I found this, hope it helps you:

    os.path.join(root, f)

提交回复
热议问题