Answer the question
In order to leave comments, you need to log in
When running the script from notepad++, there is no file in the same folder, what should I do?
Of course, I am aware of different IDEs, I mainly use PyCharm myself, but for scripts for a couple of lines I usually
take
notepad
++ those that open files not by the full path,
for example, there is a simple script:
with open('file.txt') as f:
print(f.read())
Answer the question
In order to leave comments, you need to log in
Esteem about concept "current directory". If the file path is relative, then it is relative to the current directory.
I suspect that the current directory when NPP is running is the directory where NPP itself is located, and it doesn't change it on startup (because it doesn't know if it should).
Try changing the launch command to something like
cmd /K cd "$(CURRENT_DIRECTORY)" && python "$(FULL_CURRENT_PATH)
" first you change the current directory to the script directory, and then you start the python with the options you need.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question