posted on 2023-05-07 20:37 read(335) comment(0) like(11) collect(1)
pycharm is a python IDE tool, which is cross-platform, powerful, and easy to operate. Below I will make a simple tutorial for beginners who use this software, hoping to bring you some help!
To learn pycharm, first we have to know what it is. pycharm is an integrated development environment for computer programming, mainly for python language development, and supports web development using Django. Simply put, it is a convenient language for artificial intelligence.
Next, we will go to the official website to download pycharm. If some friends do not understand or are not used to the English version, we can download the Chinese version to change it into a Chinese version .
After everything is done, open pycharm. First of all, we have to understand the panel of pycharm, the function and composition of each button, and how pycharm works.
Next we learn the basic syntax of pycharm.
1 Variable: As the name implies, it is the amount whose value is always changing, because the value is always changing, so it is called an identifier
2 Integers: collectively referred to as positive integers, negative integers, and zero, defined as int types
3 Floating point numbers: numbers with decimal points
4 Indentation: The indentation of the code line determines the affiliation between the codes
5 Comments: In python, single-line comments are marked with a pound sign (#), and the purpose is to explain the instructions on a certain line
6 string: is a series of characters
7 List: It is composed of a series of elements arranged in a specific order
8 Dictionary: It is another variable data structure, and can store any type of object
9 Operators: Generate new variables based on existing variables
10 Conditions: It means that the program code chooses to execute specific codes according to the judgment conditions
11 Loops: Constantly repeating loops
12 Functions: Independent and closed code blocks that complete specific functions and can be called anywhere
Then we started to try to practice the operation
First of all, we have to create a python project , create a file in the project, and program can be written in the file, why can't we create the file directly? We can understand that this project is equivalent to a general file. We write programs that need to run a lot of content and store them in multiple files, so we can put them in the general file and run them synchronously, that is, it becomes a project.
Then some of us may not be used to the background, we can set the background, text size, color, etc. by ourselves.
Below I will describe some steps in detail for your reference.
1. Preparation
(1) Install pycharm and make sure it can be used.
(2) Although pycharm is generally mainly in English, it is very difficult for beginners to learn, so you can download a Chinese package to turn it into a Chinese version.
2. The overall structure after opening
3. Create your first python project
1 First, open the file and create a new project
2 Modify the project location, modify the python version, and confirm
3 Right-click to add a new project, create new, python File
4 Take the file name, click python file, and create the first python file
5 Enter the content, run the project, right-click the blank and click to run, or the triangle in the upper right corner can also be used
6 running results
Fourth, python common basic settings
1 set color
If you don't like the background color and font color, no problem, you can solve it, click on the file, set, click on the editor, open the switch color scheme, console color, choose your favorite color, whether it is the background color or the font color set by oneself.
2 Set the font size
Think the font is too small? This setting can change the font. Click Settings, click Font to select the font and adjust the size
Click General, check the second one to control the font size with Ctrl+wheel
3 Breakpoints and Debugging
Breakpoint: It is the place where you deliberately stop or let the debug program stop
Debugging: When the program stops, we can debug step by step, see the results of each step of the program, and let us find defects or problems
(1) How to add a breakpoint: just left-click in front of the code
(2) Debug breakpoint: click on the green beetle or right click and select debug
After clicking, it will run to the first breakpoint position, and the variable information or parameters before the breakpoint will be displayed below
Then we continue to run down, click the key in the figure or F8, you can step to the next breakpoint
At the end of the execution, we can see that the above variable information is displayed below, maybe this is not obvious, let me do a simple debugging
As you can see from the picture above, this code has been debugged, and the values of each variable can be seen in the following results, which is obvious. So breakpoint debugging is very important, not only can let us know the running process, but also reduce program errors
Author:kkkkkkkkkkdsdsd
link:http://www.pythonblackhole.com/blog/article/325/9ac3822a06116c317ff0/
source:python black hole net
Please indicate the source for any form of reprinting. If any infringement is discovered, it will be held legally responsible.
name:
Comment content: (supports up to 255 characters)
Copyright © 2018-2021 python black hole network All Rights Reserved All rights reserved, and all rights reserved.京ICP备18063182号-7
For complaints and reports, and advertising cooperation, please contact vgs_info@163.com or QQ3083709327
Disclaimer: All articles on the website are uploaded by users and are only for readers' learning and communication use, and commercial use is prohibited. If the article involves pornography, reactionary, infringement and other illegal information, please report it to us and we will delete it immediately after verification!