Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

The method of notepad running python Code

Shulou Source: shulou.com Published: 2022-06-02 18:54:08 10月20日 Update

Editor to share with you the method of running python code in notepad. I hope you will gain a lot after reading this article. Let's discuss it together.

Notepad++ is very popular among programmers, in which the operation and maintenance staff also like to use, powerful functions, many plug-ins, the key can also directly run python scripts.

The process of running python code in Notepad++ is actually a call to cmd (command prompt) to run python code, so make sure you have python installed.

To run the python code in notepad:

1. Open the python file with notepad++. Or create a new file and save it in .py format.

2. There is a run above 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, which is not the cmd run window that comes with the system. Enter the name of the running program in the input box as follows: cmd / KC:\ 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 the content this time and make it easy to use later. We click Save.

Shortcut means shortcut key, here is the need for us to fill in the name of the save shortcut key, I named it run_python, shortcut key is ALT+SHIFT+R. Look at the definition of your personal habits.

When we reopen the menu bar, we find that there is an extra run_python option under the run menu, and shortcuts are displayed on the right-hand side.

Press the shortcut you just entered to run the current python file. In the future, just press the shortcut key to run the python file, and you don't need the previous steps.

After reading this article, I believe you have a certain understanding of the way notepad runs python code. Want to know more about it. Welcome to follow the industry information channel. Thank you for your reading!

Tags: Run shortcut key code file menu input method content step program article script path powerful personal human key functional powerful just need Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia vpn Xiaomi Redmi OPPO Reno