Help w/ console.run editor output
-
Hello,
I’m trying to get output from an .exe call to return to the new editor window, but its only posting to the console window. Below is some “test” code to demonstrate the issue. Thanks for any help!from Npp import editor, notepad, console
import timeconsole.clear()
console.show()notepad.new()
time.sleep(0.3) # Delay 300ms to allow above cto complete
console.run(r’C:\Software\dcmtk-3.6.9-win64-dynamic\bin\echoscu.exe -v -aet TEST -aec TEST123 127.0.0.1 105’, editor)
console.run(r’cmd.exe /c “C:\Software\dcmtk-3.6.9-win64-dynamic\bin\echoscu.exe -v -aet TEST -aec TEST 127.0.0.1 105”‘, editor)
console.run(r’cmd.exe /c ping localhost’, editor) -
The editor object used in the console is the same class as the normal editor object.
from Npp import console console.clear() print("hello") content = console.editor.getText() notepad.new() editor.setText(content)
But if you are working with external programs, the subprocess module might be a better alternative
-
@Ekopalypse Great, that will suffice for what I’m trying to do. Thank you!