python - 文件未找到错误: [Errno 2] No such file or directory: get file from a folder macbook

标签 python python-3.x macbookpro-touch-bar

我不知道我做错了什么。我复制了路径链接并在代码中使用了它,但仍然收到错误。下面是我尝试运行的代码和路径。

import os
def rename_files():
    file_list = os.listdir("Macintosh HD/Users/engpen/downloads/prank")
    print(file_list)

最佳答案

宁可使用。然后一步步检查你的路径是否正确。

os.path.join()

关于python - 文件未找到错误: [Errno 2] No such file or directory: get file from a folder macbook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54164858/

相关文章:

python - 如何更改字典中键值对的顺序?

python-3.x - Cython 相对导入错误,即使在进行绝对导入时也是如此

Swift:如何将 Touch Bar 控件链接到主窗口控件

XCode:如何在测试运行期间禁用 Touchbar 模拟器运行?

python - 从Python字典访问数据

python - python 中的触摸条支持

python - 如何使用 python discord api 中的 add_roles 方法

python - Pysvn 安装程序无法检测到 Python 安装

python - Swig 从 Base* 向下转型到 Derived*

python - 用新的 Dataframe 替换一行