简体   繁体   English

Python 模块更改文件夹名称

[英]Python Module change folder name

I am in the process of transferring my data science projects from the desktop to the Cloud and find it very interesting and started working with Google Colab recently.我正在将我的数据科学项目从桌面转移到云端,发现它非常有趣,最近开始与 Google Colab 合作。

Currently, I am working in a notebook and I imported a Python module (.py file) with functions that I wrote.目前,我在笔记本上工作,并导入了一个 Python 模块(.py 文件),其中包含我编写的功能。 In this module, some functions state that Python should open a file from folder “data”, which was a folder on my desktop.在这个模块中,一些功能 state ,Python 应该从文件夹“数据”打开一个文件,这是我桌面上的一个文件夹。 Now I am getting the following error message:现在我收到以下错误消息:

FileNotFoundError: [Errno 2] No such file or directory: 'data/my_filename.csv'

What should I change in my .py file so that the correct CSV files will be opened?我应该在我的.py文件中进行哪些更改,以便打开正确的 CSV 文件? All CSV files are now transferred to Google Drive.所有 CSV 文件现在都传输到 Google Drive。

zvone is right . zvone 是对的 Actually, I did change that but found out that I repeatedly made a mistake not to include /content/drive in the path.实际上,我确实改变了它,但发现我反复犯了一个错误,没有在路径中包含/content/drive

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM