Open mrrezaie opened 1 month ago
The Execute Selected Text
does exactly what its name says: executes the selected text as is, without any implicit changes.
If you want to alter this behavior, you may write an NppExec's script and assign a shortcut key to that script.
https://d0vgan.github.io/nppexec/?q=3.7
@d0vgan, thanks for your response. Indeed I want the outputs to be printed in a new line. If I run a cell with a couple of prints in the middle, this happens:
>>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> prints something
>>> >>> >>> >>> >>> >>> >>> >>> ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... >>> finished
>>> >>> >>> >>> >>>
Actually, I have no idea how to alter this behavior. I was wondering if you could help on this as well. Thank you.
Hmm, when there is interactive python (such as python -i -u
) running in NppExec's Console and you quickly press Enter several times in NppExec's Console, you'll get something similar to the following as the result:
>>> >>> >>>
If you slowly press Enter several times, you'll get the following:
>>>
>>>
>>>
So it looks like new lines in the output are "swallowed" by NppExec when several lines (remember: pressing Enter in NppExec's Console is the same as passing an empty line) are passed to python as an input.
On the other hand, if I do the very same actions with cmd
, I always get the following, disregarding of whether Enter was pressed quickly or slowly:
C:\Users\UserName\AppData\Local\Temp>
C:\Users\UserName\AppData\Local\Temp>
C:\Users\UserName\AppData\Local\Temp>
As you can see, cmd
does not demonstrate this "cumulative effect" in its output.
This seems to be related to the fact that NppExec uses pipes to deal with console process'es input/output as mentioned here:
https://d0vgan.github.io/nppexec/?q=1.3
Unfortunately, NppExec does not have any control of the pipes' behavior which is fully controlled by the system (Windows). I'll see if I could do something with python here, but I can't promise anything.
Hi, when using
Execute Selected Text
orExecute Clipboard Text
, codes are not executed in new line and this happens:https://github.com/user-attachments/assets/92ba98b6-6f83-4a5b-8039-f14a45dfbb13
It would be great if NppExec starts with new line after execution the codes.
Thank you.