简体   繁体   中英

How to Run Python on Komodo IDE that read from text file?

I am using Komodo IDE and have a python file that reads text from a text file, does calculations, then outputs to the console. I am using a command to run the file, with the phrase %(python3) -u "%F in the command part.

When I run this file in debugger, it works fine, but when I run it using the command to output to Command Output, this error pops up:

Traceback (most recent call last): File "C:\\Users\\Haseeb\\Desktop\\Saud\\A School Work\\Z-Computer Programming\\ECOO Practice\\2010Problem1.py", line 1, in <module> f = open('2010DATA.txt', 'r') FileNotFoundError: [Errno 2] No such file or directory: '2010DATA.txt'

This command runs other programs, just not ones that read from text files. Here is a picture of the code, command and and error.
在此处输入图片说明

Any help would be highly appreciated.

您需要将“开始于”目录设置为执行命令的目录,或者避免使用相对路径。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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