The process of NotePad running python code is actually calling cmd (command prompt) to run the python code, so make sure you have installed python.
Recommended tutorial: notepad graphic tutorial
1. Open the python file with notepad. Or create a new file and save it in .py format.
#2. Run the python file directly and press F5. In the pop-up menu, enter: cmd /k C:\Users\Fengqiao_x\AppData\Local\Programs\Python\Python36\python.exe "$(FULL_CURRENT_PATH)"& PAUSE & EXIT Note: The path must be yours python path.
3. Click Save. Enter your favorite name and shortcut key (choose a shortcut key that is easy to remember, and the shortcut key definition cannot be repeated). Then click OK.
#4. 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 effect is as follows.
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!