Home > Development Tools > notepad > body text

How to run python program in notepad

angryTom
Release: 2019-08-20 09:35:51
Original
7431 people have browsed it

How to run python program in notepad

This article brings you the detailed process (pictures and text) of how notepad runs python. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

##notepad download address:

http://www.php.cn/xiazai/gongju /92

Recommended tutorial:

notepad usage tutorial

1 Display spaces and indicators

Why is this recommended? Because judging whether Python statements are at the same level mainly depends on indentation. The most feared thing in Python programs is the mixed use of spaces and tabs, which causes errors that are sometimes difficult to find. Especially when we download some source code from the Internet, there are always running problems. After the circled part in the picture below is checked, in NotePad, the space will be represented as "." and the Tab key will be represented as "→", which is easy to identify and very convenient.

2 Automatic line wrapping

After this is checked, if the code is very long, it will automatically Give you a line break so you don't have to drag the slider to see .

3 Configure tab characters

It is strongly recommended to replace this tab symbol with spaces (4), completely Solve the problem of mixing spaces and tabs.

Notepad ->"Settings" menu->"Preferences" button->"Language" button

As shown below Change the place.

4Autocomplete

It is recommended to check these places so that you can use NotePad The editor can automatically help you complete other parts.

##Notepad ->"Settings" menu->"Preferences" button->"AutoComplete" button

As shown below Change this place.

The effect is as follows:

5Configure debugging tools

  1. Notepad ->"Run" menu->"Run" button

  2. ## Enter the following command in the pop-up window:
  3. cmd /k python "$(FULL_CURRENT_PATH)" & ECHO. & PAUSE & EXIT
    Copy after login

    Then click "Save" and choose a name at will, such as "RunPython". For convenience, configure the shortcut keys (such as Ctrl R), click OK. Afterwards, to run the Python file, just press the configured shortcut key or click "RunPython" on the run menu.
Note: A prerequisite for normal operation here is that Python has been added to the environment variable, that is, entering Python in cmd can parse the command normally.

6python configuration environment variable configuration diagram:

7Run the python program

The above is the detailed content of How to run python program in notepad. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!