使用 行政会议,你还可以在使用 npp_save指挥官运行之前保存 python 文件,使用 cd "$(CURRENT_DIRECTORY)"指挥官设置工作目录,或者使用 cd "$(CURRENT_DIRECTORY)"0 cd "$(CURRENT_DIRECTORY)"1在 互动模式运行 python 程序。我在网上找到了很多提到这些选项的链接(cd "$(CURRENT_DIRECTORY)"2 cd "$(CURRENT_DIRECTORY)"3 cd "$(CURRENT_DIRECTORY)"4 cd "$(CURRENT_DIRECTORY)"5 cd "$(CURRENT_DIRECTORY)"6) ,但是我在 cd "$(CURRENT_DIRECTORY)"8找到的运行 python 程序的最佳方式是使用 行政会议:
npp_console - // disable any output to the Console
npp_save // save current file (a .py file is expected)
cd "$(CURRENT_DIRECTORY)" // use the current file's dir
set local @exit_cmd_silent = exit() // allows to exit Python automatically
set local PATH_0 = $(SYS.PATH) // current value of %PATH%
env_set PATH = $(SYS.PATH);C:\Python27 // use Python 2.7
npp_setfocus con // set the focus to the Console
npp_console + // enable output to the Console
python -i -u "$(FILE_NAME)" // run Python's program interactively
npp_console - // disable any output to the Console
env_set PATH = $(PATH_0) // restore the value of %PATH%
npp_console + // enable output to the Console
npp_console - // disable any output to the Console
npp_save // save current file (a .py file is expected)
cd "$(CURRENT_DIRECTORY)" // use the current file's dir
set local @exit_cmd_silent = exit() // allows to exit Python automatically
set local PATH_0 = $(SYS.PATH) // current value of %PATH%
env_set PATH = $(SYS.PATH);C:\Python34 // use Python 3.4
npp_setfocus con // set the focus to the Console
npe_console m- a+
npp_console + // enable output to the Console
python -i -u "$(FILE_NAME)" // run Python's program interactively
npp_console - // disable any output to the Console
env_set PATH = $(PATH_0) // restore the value of %PATH%
npp_console + // enable output to the Console