Script issue not showing in Notepad++
-
Hello there.
I have Python 3.12.6 and Notepad++8.6.8 just installed. Inside Notepad++, I have a very simple script like RUN $(FULL_CURRENT_PATH)
. The code below works in the Python interpreter. But when I try ro run it in Notepad++, there is a quick black window that appears then goes away. I saw one post that said to have a statement in the Python script so that it waits for the user to press a key to continue. That wait for key code is the msvcrt.getch() statement. I was wondering why I don’t see the execution of the Python script? I am all new to do and I am looking forward to learn. AnyThanks
import msvcrt, oscoord_a = input ("Enter coord A: ")
coord_b = input ("Enter coord B: ")
print ("Coord a is " + coord_a + " .Coord b is " + coord_b)
print(“Press any key to continue…”)
msvcrt.getch()
os.system(‘cls’) -
@Dr-Sylvain-J-R-Garceau-Bergeron ,
I am going to assume that you don’t actually type
RUN $(FULL_CURRENT_PATH)into the Run dialog, because that’s obviously not what you’d type at a command line to get it to work – becausepythonis the name of the interpreter, notrun…When I do Run > Run… >
python "$(FULL_CURRENT_PATH)", it does exactly what I’d expect with your code: it opens the cmd.exe window, prompts for the inputs, then prompts to press any key to continue, then closes after it has cleared the screen.(Note: I use quotes around the
$(FULL_CURRENT_PATH)so that the whole path will be passed to python, even if there is a space somewhere in the directory or filename)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login