我正在使用Jupyter笔记本,并试图将当前工作目录更改为我的系统目录,即“C:/Users”,但它给了我一个错误:FileNotFoundError:[Errno 2]没有这样的文件或目录:“C://Users”。 然而,同样的方法在空闲状态下也能正常工作。请帮忙。在
这是在朱皮特笔记本里试过的
```import os
cwd = os.getcwd()
files = os.listdir(cwd)
os.chdir("C://Users")
os.getcwd()
-----------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-16-03f5279edef8> in <module>
2 cwd = os.getcwd()
3 files = os.listdir(cwd)
----> 4 os.chdir("C://Users")
5 os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory: 'C://Users'
```
目前没有回答
相关问题 更多 >
编程相关推荐