1) I put an Execute.bat file in C:\Program Files\Notepad++\plugins to run my python file inside Notepad++.
I open the console and launch. The console gives me an error: CreateProcess() failed, which seems to be a Windows error.
What am I doing wrong ?
2) Alternatively, when I try to execute Python with Execute and choosing python.exe, the file seems to run (it opens a shell window) but the shell closes immediately. How can I keep it opened ? I'd like not to alter my python files with additional instructions such as raw_input()
I am working with Win XP SP2
Any help would be much appreciated
Thanks in advance
Dominique
Execute.bat
@echo off
REM A batch file for executing a command on the file currently being edited.
if /i %~x1 == .hhp goto HtmlHelpProject
if /i %~x1 == .py goto Python
goto NoMatch
:HtmlHelpProject
echo Executing tool associated with Html Help project.
"c:\program files\html help workshop\hhc.exe" %1
goto End
:Python
echo Executing tool associated with Python script.
"c:\Python25\python.exe" -m %~n1
goto End
:NoMatch
echo The current file has no execute tool associated with it.
goto End
:End
pause
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually, I don't completely understand what is the problem, but here is an example how I execute AWK files from Notepad++:
1) copy awk.exe (or awk95.exe) to your Notepad++'s folder
2) create or open an AWK file (a text file containing some AWK program)
3) press F6 (or Plugins -> NppExec -> Execute...) and type the following:
// save current file
NPP_SAVE
// execute current file (.awk file expected)
"$(NPP_DIRECTORY)\awk.exe" -f "$(FULL_CURRENT_PATH)"
4) press OK and your AWK program will be executed.
You can do similar steps to run your .py files.
However, be sure that your version of Python does not require a real console. I mean, it may require an existing text-mode screen buffer which can be provided only by a real console. Whereas NppExec's Console window is actually a RichEdit's window which shows the output redirected through pipes, so it has no text-mode screen buffer.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think you get "CreateProcess() failed" because your bat-file can not be found. Try to
1) specify a full path to your bat-file
2) or place the bat-file into Notepad++'s folder (not to Notepad++\plugins folder) and specify "$(NPP_DIRECTORY)\Execute.bat" instead of just "Execute.bat"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
First, Notepad++ is a really great software.
1) I put an Execute.bat file in C:\Program Files\Notepad++\plugins to run my python file inside Notepad++.
I open the console and launch. The console gives me an error: CreateProcess() failed, which seems to be a Windows error.
What am I doing wrong ?
2) Alternatively, when I try to execute Python with Execute and choosing python.exe, the file seems to run (it opens a shell window) but the shell closes immediately. How can I keep it opened ? I'd like not to alter my python files with additional instructions such as raw_input()
I am working with Win XP SP2
Any help would be much appreciated
Thanks in advance
Dominique
Execute.bat
@echo off
REM A batch file for executing a command on the file currently being edited.
if /i %~x1 == .hhp goto HtmlHelpProject
if /i %~x1 == .py goto Python
goto NoMatch
:HtmlHelpProject
echo Executing tool associated with Html Help project.
"c:\program files\html help workshop\hhc.exe" %1
goto End
:Python
echo Executing tool associated with Python script.
"c:\Python25\python.exe" -m %~n1
goto End
:NoMatch
echo The current file has no execute tool associated with it.
goto End
:End
pause
Actually, I don't completely understand what is the problem, but here is an example how I execute AWK files from Notepad++:
1) copy awk.exe (or awk95.exe) to your Notepad++'s folder
2) create or open an AWK file (a text file containing some AWK program)
3) press F6 (or Plugins -> NppExec -> Execute...) and type the following:
// save current file
NPP_SAVE
// execute current file (.awk file expected)
"$(NPP_DIRECTORY)\awk.exe" -f "$(FULL_CURRENT_PATH)"
4) press OK and your AWK program will be executed.
You can do similar steps to run your .py files.
However, be sure that your version of Python does not require a real console. I mean, it may require an existing text-mode screen buffer which can be provided only by a real console. Whereas NppExec's Console window is actually a RichEdit's window which shows the output redirected through pipes, so it has no text-mode screen buffer.
try starting CMD first and then execute the batch file, see if that works
I think you get "CreateProcess() failed" because your bat-file can not be found. Try to
1) specify a full path to your bat-file
2) or place the bat-file into Notepad++'s folder (not to Notepad++\plugins folder) and specify "$(NPP_DIRECTORY)\Execute.bat" instead of just "Execute.bat"
Thanks for your help.
No, I managed to run the .py files.
The only thing is that they run with the shell instead of the Notepad++ console.
If any of you has an idea...
Thanks a lot
Dominique