Notepad is very popular among programmers, and operation and maintenance personnel also like to use it. It has powerful functions and many plug-ins. The key is that it can also run python scripts directly. Let me introduce to you how to run python script files on notepad. method.
Notepad The process of running python code is actually calling cmd (command prompt) to run the python code, so make sure you have installed python.
Steps for notepad to run python code:
1. Open the python file with notepad. Or create a new file and save it in .py format.
2. There is a Run on the menu bar. We click Run->Run, or use the shortcut key F5.
#3. 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
Note: The path must be your python path.
Since we often need to call python directly under notepad to run the script, we need to save and use the content this time for future 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. Let’s look at your own definition of personal 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.
Press the shortcut key you just entered to run the current python file. In the future, you only need to press the shortcut key to run the python file, no previous steps are required.
The above is the detailed content of How does notepad run python code?. For more information, please follow other related articles on the PHP Chinese website!