Open notepad, there is a run on the menu bar, we click Run->Run, or use the shortcut key ALT R.
#After clicking the run menu, the run window in notepad will pop up, not the cmd run window that comes with the system. The input box for entering the name of the running program is:
cmd /k C:\Python27\python.exe "$(FULL_CURRENT_PATH)" & PAUSE & EXIT
##Related recommendations: "Notepad usage graphic tutorial"
Since we often need to directly call python to run scripts under notepad, we need to save and save the content this time for future use. use. We click save. shortcut means shortcut key. Here we need to fill in the name of the saved shortcut key. I named it run_python and the shortcut key is ALT SHIFT R. It depends on your own personal definition of habits. Reopening the menu bar, we found that there is an additional run_python option under the run menu, and shortcut keys are also displayed on the right hand side. After we configured notepad, we ran the python script directly. We used the previous script to run it directly to verify it. We ran it directly with ALT SHIFT R. The result was an error because the path was incorrect. , we change it to an absolute path. If I change the path of the file to an absolute path, add E:\\python\\baopo\ in front of the file. Then run ALT SHIFT R again, and there is no problem.The above is the detailed content of How to run python in notepad. For more information, please follow other related articles on the PHP Chinese website!