[Eclipse] Build a python environment; run the first python program helloword

Table of contents

0. Environment

1. Need to prepare & build ideas

2. Build specific steps

1) Check if python is installed

2) Install eclipse

3) Install and configure pyDev

3. Create the first python program specific steps

1) Create a new project

2) Enter the project name, and configuration options

3) Create a .py file

3) Enter the print statement

4) Run, select [Python Run]

5) Console view and print


0. Environment

My environment:

windows11 64th + python 3.10 + eclipse 2021-06 + pyDev 10.2.1

Most of the environment construction part of this blog is attached with reference links (all of which I refer to when setting up the environment) for learning reference

1. Need to prepare & build ideas

Need to prepare:

1) python3.10 (unlimited version)
2) eclipse (can be downloaded from the official website, or use the decompressed package)
3) pyDev (just download the new version)

[ If you only run python, you don't need to download and configure the jdk environment ]

With the above three components, you can run python on eclipse

Build ideas:

1) Download python;

2) Download the eclipse-configuration Chinese package (optional);

3) Download pyDev (you can use the eclipse software to install, or you can download and copy the relevant files to eclipse, the first way I failed, so I copied it by myself with the offline package);

4) Configure pyDev (configure the path of python.exe in the preferences);

5) Test the python program;

2. Build specific steps

1) Check if python is installed

[win + R] to call out the [run window], enter [cmd] to enter the command line interface, enter the command [ python --version ] to check the python version, if there is a version number, it means that python has been installed, if not, it means that it has not been installed

If you have not installed python on your computer, please refer to the following blog to install python. It is very detailed. You can choose the latest version of python for download, or you can choose a version that you think is stable.

python installation reference link

2) Install eclipse

There are two ways, one is to download from the official website, which needs to be installed; the second is to download the compressed package, and then use it after decompression (the blogger uses the compressed package, which is more convenient)

Eclipse official website download reference link

The eclipse decompression version of the compressed package can be used after downloading and decompressing, the download link

After the installation is complete, you can refer to the following blog if eclipse has Chinese needs

eclipse finished link

3) Install and configure pyDev

pyDev also has two installation methods, one is to install directly through the [Install New Software] function in eclipse, and the other is to install through offline package download (the blogger installs it through the second offline package download method)

To install and configure pyDev in the first way, please refer to the following link:

[Install New Software] way to install and configure pyDev

To install pyDev in the second way, please refer to the following link, and to configure pyDev, please refer to the above link:

Install pyDev offline, refer to the [Offline Installation] section in the blog

After configuring pyDev, even if the environment is set up, you can start the first python program

3. Create the first python program specific steps

After installing the environment, open eclipse is such an interface, then we start to build a python project

1) Create a new project

Click [File] - [New] - [Project]

Select [PyDev] - [PyDev Project], click [Next]

2) Enter the project name, and configuration options

It should be noted that you need to manually select [python] in the fourth box (the text marked with a star), and most of the other options are default, and then click [Finish]

After building the project, you can see the project you just created in the navigation bar, and then you need to create a .py file

3) Create a .py file

Right-click the project name, select [New] - [File]

Enter the name of .py, and click [Finish]

Note: The file name must end with .py

3) Enter the print statement

4) Run, select [Python Run]

5) Console view and print

So far, an eclipse that can run python has been built

Some steps in the blog are attached reference links (maybe not particularly detailed), if you have any questions, you can leave a message

--END--

Guess you like

Origin blog.csdn.net/qq_41539778/article/details/132615759