Pycharm introduction and use

Using native Python IDLE
IDLE is a Python package comes with an integrated development environment, click Start -> Python installation package -> IDLE. Start IDLE, displays >>> >>> can enter the code behind. It will be performed immediately after the transport Python Shell enter the code, and display the results performed directly below. As shown below:

  1. Pycharm introduction and use

  2. Pycharm introduction and use

Code written in native IDLE mode only stay in the memory of them, after the close of native IDLE will go away, if we want to save up code, the menu bar File -> New File or shortcut keys Ctrl + N to open a new window, write code in this file, select the file menu bar after completion -> save or save + S shortcut keys Ctrl.

  1. Pycharm introduction and use

Although Python comes with IDLE, but this is not recommended. We in the actual project development, may need to open a number of .py file to switch. If that comes with Python IDLE, may put myself around the halo. When a third-party IDE open multiple .py file, the page is more friendly. As well as the following advantages: a smart prompt, color coding, the code branches, automatically, unit testing, version control and the like. What useful Python IDE then there is what? Hereinafter will be recommended for everyone.

Using third-party IDE
IDE (Integrated Development Environment), an integrated development environment. It is used to provide application development environment, generally including code editor, compiler, debugger, and graphical user interfaces and other tools. Integrated coding function, integrated analysis capabilities, compilation, debugging features such as software development services suite.

Commonly the IDE
the Atom, Sublime, PyCharm, Python user VS Code is used several IDE. I only used the Atom, Sublime, Pycharm, on which several IDE What is the difference, what are the advantages and disadvantages, do not make too much description, the reader can be downloaded using Quguan network. Nearly two years, I used more of a Pycharm, following a brief installation and use of under Pycharm.

Pycharm installation
Pycharm installation package can be downloaded at the official website http://www.jetbrains.com/pycharm/, as shown below:

  1. Pycharm introduction and use

Click Download can see there are two versions of professional (Pro) and community (Community Edition), Professional version for a fee, Community is the free version. Because the topic will focus on how to implement the interface automated testing by Python, less involved in development, so we download community (community edition) can be. As shown below

  1. Pycharm introduction and use

Installation is simple, and has been click Next to.

  1. Pycharm introduction and use

  2. Pycharm introduction and use

  3. Pycharm introduction and use

After Pycharm installed, if there is no shortcut icon to the desktop, open the installation path Pycharm, such as the author of Pycharm installation path is C: \ Program Files \ JetBrains \ Pycharm Community Edition 2018.3.1, open the bin file, send exe file to your desktop.

  1. Pycharm introduction and use

Double-click to open Pycharm, it will enable us to create a general project. We click on the Create New Project

  1. Pycharm introduction and use

  2. Pycharm introduction and use

  3. Pycharm introduction and use

Pycharm we need to manually set the python environment. Remember the above make you remember the installation path of Python do? The author is C: \ Users \ Administrator \ AppData \ Local \ Programs \ Python \ Python36. We click on File -> Settings -> Project: untitled (untitled refers to the folder name) -> Project interrupt, add python.exe file path.

  1. Pycharm introduction and use

  2. Pycharm introduction and use

So far, Python environment installed, Pycharm installed, the environment also have a good job, let's start the first program to run it!

First, right-click the file we just created folder. Select New -> Python File, create a test.py file. Most of the new learning a language should print a Hello World. Ok! We are no exception. We enter the code in the input area print ( "HelloWorld"), right-click, click Run test. We can see that the console has been out of print Hello World. Congratulations! You have completed your first program!

  1. Pycharm introduction and use

  2. Pycharm introduction and use

  3. Pycharm introduction and use

We know that only prints a "Hello World" is definitely not enough. In practice, although most of the time will be for the "Google" or "Baidu" programming, but also because there are some basic Python. In simple terms, if Python basic grammar are confused, the program is out of the question! Python is a good basis for the necessary conditions to do automation. Then you might ask, is not what I want to learn Python special slip it? The author's answer is, if you can learn a particular slide is good, if not, it does not matter. Let's learn some of the basics of Python, let us mind the concept of a Python, and other higher-order knowledge can wait to a certain level when we go to learn. Below I will be starting from zero base Python, as much as possible with the most simple language to describe the basic syntax of Python, Python let you quickly master the basics!

Welcome attention to micro-channel public number: Wang software testing. Software testing exchange group: 809 111 560

Guess you like

Origin blog.51cto.com/14421641/2415248