Follow 👆 the public account and reply with 'python' to get the beginner tutorial! Source from the internet, please delete if infringing.
For those who are encountering Python for the first time, whether for web scraping or AI development, many say the Python language is simple. Learning more is always beneficial. Below is a record of the installation of Python from the perspective of a complete beginner, including issues encountered, so that even those who know nothing can get started with installation and complete their first Hello World code.
【Instructions are at the end!!】
【Instructions are at the end!!】
[Installing Python]
Currently, Python has two versions: 2.x and 3.x, which are incompatible with each other. As version 3.x becomes more popular, our tutorial will be based on the latest Python 3.9 version.
[Python Installation] The installation package is at the end (no activation required)
Currently, Python has two versions: 2.x and 3.x, which are incompatible with each other. As version 3.x becomes more popular, our tutorial will be based on the latest Python 3.9 version.
Go to the official Python download page
http://www.python.org/download/
Many versions appear, we choose the latest version 3.9.0
After downloading, click run, and the installation interface will appear. Remember to check the box
If this appears, the installation was successful
2. Running PythonAfter successful installation, open theCommand Promptwindow (win+R, type cmd and hit enter), type python, and you will encounter two scenarios:
Scenario 1:
This indicates that Python has been installed successfully. If you see the prompt >>>, it means you are already in the Python interactive environment, and you can input any Python code to get immediate execution results. Now, type exit() and hit enter to exit the Python interactive environment (or just close the command window).
Scenario 2: An error occurs:
I won’t demonstrate here, as I have installed successfully. I will demonstrate using an incorrect ‘pythonn’ instead of ‘python’ to show the error message.
3.Configuring Environment Variables
This is because Windows searches for python.exe based on the Path environment variable. If it can’t find it, an error will occur. If you missed checking the box to Add Python 3.9 to PATH during installation, you will need to manually add the path where python.exe is located to the Path.
If you find you forgot to check or don’t know how to set the PATH variable, just reinstall and remember to check Add Python 3.9 to PATH (Step 2: Errors are generally caused by not configuring the environment variable).
4. Steps: Right-click My Computer -> Select Properties -> Select Advanced System Settings -> Select Environment Variables in the bottom right corner
The environment variables mainly consist of user variables and system variables. The environment variables that need to be set are in these two variables. The user variable allows you to use downloaded programs in the cmd command by writing the absolute path to the user variable.
5. Test Output Press win+R, type cmd and hit enter
Type python and hit enter to enter the Python development environment
Note that when calling functions (like print), parentheses are needed, otherwise it will prompt an error
To directly output a string after print, you need to enclose the string in double or single quotes. You may find that print can output various strings, numbers, calculation results, and comparison results. Try printing some other things to see which succeed and which fail, and if you’re interested, guess the reasons for the failures.
.
In fact, in the Python command line, print can be omitted, and it will default to outputting the result of each command. Just like this:
[ Installing Development Tools ]
Install the PyCharm tool. I have a portable version that requires no installation, just unpack it to use. Here, I will demonstrate the installation process of the PyCharm development tool.
You need to follow my public account and send ‘python’ to receive it directly.
.
.
When you first openPyCharm, this will be displayed
By selecting this, a venv folder will be created, and when creating a new project, a new virtual environment is created by default
If you do not need the venv virtual environment folder, select the second option and set the Python environment, which is not set by default.
Click next to complete the creation of an empty project.
Create a folder for classification management.
Create a Python file where you can write Python statements.
Run a Python code to print the first Python code, Hello World hahaha!!!
PyCharm plugins
Download the Chinese language pack plugin
Click the card below to send ‘python’ to get the installation package for the plugin
Since PyCharm opens in English, downloading this language pack plugin and restarting will display it in Chinese.
.Open File -> Settings… a window will pop up
In the “marketplace” section, type “Chinese” in the input box to find the language pack plugin, click “install” to download it
Click restart
The activated installation package has been prepared for everyone
How to get it
1. Like + View
2. Reply ‘python’ in the background
-
Finally, we have prepared some programming learning materials for you to learn efficiently
-
1. Learning Path for All Python Directions
-
A compilation of all technical points in Python directions, forming a summary of knowledge points in various fields. Its usefulness lies in that you can find corresponding learning resources according to the knowledge points above, ensuring a comprehensive learning experience.
-
2. Essential Development Tools for Python
All tools have been organized for you, just install and you can start!
3. Latest Python Learning Notes
When I reach a certain foundation and have my own understanding ability, I will read books or handwritten notes compiled by predecessors. These notes detail their understanding of some technical points, which are quite unique and can provide different insights. There are 100 e-books available for you, so you don’t have to buy them yourself.
4. Python Video Collection
Watching comprehensive zero-based learning videos is the quickest and most effective way to learn. Following the teacher’s thoughts in the videos, from basics to advanced, makes it easy to get started.
5. Practical Cases
What you learn from books is only superficial. You need to practice hands-on to apply what you’ve learned in reality. At this time, you can work on some practical cases to learn.
6. Interview Guide
Resume Template
How to get:
-
Like + View
-
Reply “python” in the public account
Receive the latest Python zero-based learning materials for 2024 by replying:Python