[8.6.2] Display live console to work with Python script?
-
Hello,
I’d like to find how to get NppExec to display the output from a Python script in a console within NPP so I don’t need to switch back and forth to Windows’ cmd window.
Thank you.
-
@Shohreh said in [8.6.2] Display live console to work with Python script?:
Hello,
I’d like to find how to get NppExec to display the output from a Python script in a console within NPP so I don’t need to switch back and forth to Windows’ cmd window.
Then congratulations, you have succeeded. The screenshot you included showed it is indeed putting the output into the Book exec console in Notepad++.
Unfortunately, your Python has an error,so the error is the only output that you see. Try a simple Hello World to see it “work”–
update: sorry, that’s showing my obvious lack of knowledge aboutexit
in Python; see more knowledgeable posts below -
-
I also tried quit(), still no output — Can’t post as text since the forum assumes it’s a link.
The code works fine when ran from a cmd window.
Too bad.
-
but now you have changed the way in which the Python script is executed. In the previous example you executed python directly, now you start a cmd that executes the python script itself.
As said before, if you want to switch to interactive mode, use os._exit(1) for example, if not, then you can use quit() as long as you understand what it does. -
@Ekopalypse said in [8.6.2] Display live console to work with Python script?:
then you can use quit() as long as you understand what it does.
Correction: this should actually read:
then you can use
exit()
as long as you understand what it does.