While I'm writing python code, I get aggravated because the shell closes before I can see what the errors/messages where. This forces me to open up my shell, navigate to the directory, and then execute the script. I find that quite inconvenient. So I figured out that entering "cmd.exe /k python "$(FULL_CURRENT_PATH)"" will keep the shell open even after script execution is completed. BTW, remove the outer quotes from the command and substitute "python" for whatever command you want to run.
Cordially,
John Tims
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had a similar problem to overcome but even worse in that the program I needed to execute is not on the system path and its path also had spaces.
I needed to run >c:\program files\html help workshop\hhc.exe c:\my documents\help_project.hhp
In order to be able to run this command on whatever file I was looking at in Notepad++ I created a batchfile in the Notepad++ directory called CompileHhp.bat containing this:
"c:\program files\html help workshop\hhc.exe" %1
pause
And then created a Notepad++ run command of the form:
I improved this further so that I can run just this one script and it automatically runs the correct tool based on the file extension of the file being edited. This batch file is invoked in the same manner as above using the Run command:
@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:\program files\python24\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:
Hey everyone,
While I'm writing python code, I get aggravated because the shell closes before I can see what the errors/messages where. This forces me to open up my shell, navigate to the directory, and then execute the script. I find that quite inconvenient. So I figured out that entering "cmd.exe /k python "$(FULL_CURRENT_PATH)"" will keep the shell open even after script execution is completed. BTW, remove the outer quotes from the command and substitute "python" for whatever command you want to run.
Cordially,
John Tims
Cool tip! Thanks for posting it. --Joel
Awesome, I have been struggling to get this to work for ages. Try this for a PHP syntax check:
cmd.exe /k C:\php\php-cgi.exe -l "$(FULL_CURRENT_PATH)"
Obviously you have to download the PHP ZIP file and extract it somewhere, then change the "C:\php\php-cgi.exe" to the path you extracted it to...
Have fun...
I had a similar problem to overcome but even worse in that the program I needed to execute is not on the system path and its path also had spaces.
I needed to run >c:\program files\html help workshop\hhc.exe c:\my documents\help_project.hhp
In order to be able to run this command on whatever file I was looking at in Notepad++ I created a batchfile in the Notepad++ directory called CompileHhp.bat containing this:
"c:\program files\html help workshop\hhc.exe" %1
pause
And then created a Notepad++ run command of the form:
$(NPP_DIRECTORY)\CompileHpp.bat "$(FULL_CURRENT_PATH)"
Hope this is useful to someone.
Neutrino.
I improved this further so that I can run just this one script and it automatically runs the correct tool based on the file extension of the file being edited. This batch file is invoked in the same manner as above using the Run command:
$(NPP_DIRECTORY)\Execute.bat "$(FULL_CURRENT_PATH)"
Here is 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:\program files\python24\python.exe" -m %~n1
goto End
:NoMatch
echo The current file has no execute tool associated with it.
goto End
:End
pause