I need help trying to run Python in Notepad++
-
Hello folks,
I am new to the world of scripting and specially new to Notepad++, I am currently trying to execute python on notepad++ I get the following error: ; about to start a child process: ; about to start a child process: “C:\Users\AEON SOUNDWORKS\AppData\Local\Programs\Python\Python37\python.exe” FirstProgram.py""
CreateProcess() failed with error code 193:
%1 is not a valid Win32 application.This is driving me crazy as I have no idea on what to do.
Thanks in advance,
David
-
How exactly did you try to run the script?
Which version of npp are you using? (Debug-Info under ? menu)
Some hints how it can be achieved are here.Cheers
Claudia -
@Claudia-Frank Hi Claudia, thanks for getting back to me. I am using this version: Notepad++ v7.5.6 (64-bit)
Build time : Mar 19 2018 - 00:23:17
Path : C:\Program Files\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS : Windows 10 (64-bit)
Plugins : DSpellCheck.dll mimeTools.dll NppConverter.dll NppExec.dllAnd I am trying to run the script the same way this guy does it on the video: https://www.youtube.com/watch?v=OS5BBSqon3E
Cheers,
David
-
Hi David,
I assume the way you provide the python interpreter to NppExec is causing the issue.
Your path contains a space between AEON and SOUNDWROKS correct?
If so take care that the complete path is encased by double quotes otherwise
NppExec would try to start a program C:\Users\AEON with paramaters SOUNDWORKS\AppData\Local\Programs\Python\Python37\python.exe” FirstProgram.py“Note, when running the program with NppExec your current working directory is the one where notepad++.exe is,
so you cannot just provide the python script name unless you have saved it under the same directory.
In your example, NppExec would try to find FirstProgram.py under the same directory where npp executable is.I would define it like this
cd "C:\Users\AEON SOUNDWORKS\AppData\Local\Programs\Python\Python37" python "$(FULL_CURRENT_PATH)"
Save it with a meaningful name and execute it the first time by pressing F6 and every other execution by pressing CTRL+F6
NppExec would change the current working directory to …\Python37 and then would call python with the full path of the
current file provided as parameter. Of course, the current document must have been saved.I hope this makes sense to you.
Cheers
Claudia -
Hey Claudia,
Thank you so much, it works now :). I feel like a complete hackerman now haha :).
Have a lovely day.
Regards,
David