Python脚本在visualstudi中交互运行时找不到文件

2024-04-19 23:25:17 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用visualstudio运行一个python文件。这不是一个项目,只是一个文件。像往常一样,一切工作正常,但当我试图利用另一个文件,它不会被找到。你知道吗

enter image description here

我得到FileNotFoundError: [Errno 2] No such file or directory: 'data.xlsx'

我使用“Execute in Python Interactive button”运行python文件

enter image description here

当我在没有调试的情况下运行Start时,一切都很好。你知道吗

enter image description here

它按预期执行

enter image description here


Tags: or文件项目noin利用executedata