![How to run python in notepad](https://img.php.cn/upload/article/000/000/037/5d4a7fe937ba0357.jpg)
Open notepad, there is a run on the menu bar, we click Run->Run, or use the shortcut key ALT R.
![1565163099351000.png How to run python in notepad](https://img.php.cn/upload/image/176/591/861/1565163099351000.png)
#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
![1565163143839281.png How to run python in notepad](https://img.php.cn/upload/image/175/627/979/1565163143839281.png)
##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.
![1565163184987548.png How to run python in notepad](https://img.php.cn/upload/image/976/558/618/1565163184987548.png)
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.
![1565163228641647.png How to run python in notepad](https://img.php.cn/upload/image/595/231/656/1565163228641647.png)
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.
![1565163256532469.png How to run python in notepad](https://img.php.cn/upload/image/371/927/360/1565163256532469.png)
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.
![1565163274584267.png How to run python in notepad](https://img.php.cn/upload/image/630/665/631/1565163274584267.png)
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.
![1565163284488247.png How to run python in notepad](https://img.php.cn/upload/image/336/492/294/1565163284488247.png)
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!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn