–pycharm Introduction to integrated development environment under Linux

Source: Internet
Author: User

650) this.width=650; "src=" Http://www.linuxprobe.com/wp-content/uploads/2017/02/124006mi4yvyz4j6q4l4hz.jpg "alt=" Linux under integrated development environment –pycharm Introduction Linux under the Integrated development Environment –pycharm Introduction "Title=" Linux under the Integrated development Environment –pycharm Introduction Linux under the Integrated development Environment –pycharm Introduction "style=" vert ical-align:middle;height:auto;margin:10px auto; "/>

Introduced

In this guide, I'll introduce you to an integrated development environment-PYCHARM, where you can develop professional applications using the Python programming language.

Python is an excellent programming language because it really implements cross-platform applications that can be run on Windows, Linux, and MAC systems without recompiling any code.

Pycharm is an editor and debugger developed by JetBrains, JetBrains is the company that developed Resharper. It has to be said that Resharper is a great tool that is used by Windows developers to refactor code, and it makes it easier for Windows developers to write. NET code. Many of Resharper's principles have also been added to the Pycharm Professional Edition.

How to install Pycharm

has written a guide on how to get pycharm, download, unzip, and then run it.

Welcome interface

When you first run Pycharm or close a project, a screen appears showing a list of recent items.

You will also see the following menu options:

    • Create a new project

    • Open Project

    • Checking out from the version control warehouse

There is also a configuration setting option that you can use to set the default Python version or some other settings.

Create a new project

When you choose ' Create a new project ', it provides the following list of possible project types for you to choose from:

    • Pure Python

    • Django

    • Flask

    • Google App Engine

    • Pyramid

    • Web2py

    • Angular CLI

    • AngularJS

    • Foundation

    • HTML5 bolierplate

    • React Starter Kit

    • Twitter Bootstrap

    • Web Starter Kit

This is not a programming tutorial, so I don't need to explain what these project types are. If you want to create a simple desktop run program that can run on Windows, Linux, and Macs, you can choose a Pure Python project and then use the QT library to develop a graphical application that looks like a native, no matter what operating system it is running on. Just like it was developed on the system.

After you select the project type, you need to enter a project name and select a Python version to develop.

Open a project

You can open an item by clicking the name of the item in the recently opened Items list, or you can click Open, browse to the folder where you want to open the project, locate the item, and then choose OK.

View from Source control

Pycharm offers options for viewing project sources from a variety of online sources, including GitHub, CVS, Git, Mercurial, and Subversion.

Pycharm IDE (Integrated development environment)

The top menu can be opened in the Pycharm IDE, where you can see the label for each open item below the menu.

On the right of the screen is the debug options area, which lets you run the code step.

The left panel has a list of project files and external libraries.

If you want to create a new file in your project, you can right-click the project's name and select ' New '. You can then select one of the following file types to add to the project:

    • File

    • Directory

    • Python Package

    • Python Package

    • Jupyter notes

    • HTML file

    • Stylesheet

    • Javascript

    • TypeScript

    • Coffeescript

    • Gherkin

    • Data source

When you add a file, such as a Python file, you can edit it in the editor on the right panel.

The text is full-color encoded and has bold text. The vertical line displays indentation, which ensures that the indentation is correct.

The editor has an intelligent completion function, which means that when you enter a library name or a recognizable command, you can press the ' Tab ' key to complete the command.

650) this.width=650; "src=" Http://www.linuxprobe.com/wp-content/uploads/2017/02/124048kjpp6pppiuk6iu6i-1.jpg "alt = "Linux integrated development Environment –pycharm Introduction Linux under the Integrated development Environment –pycharm Introduction" Title= "Linux under the Integrated development Environment –pycharm Introduction Linux under the Integrated development Environment –pycharm Introduction" style= "VE rtical-align:middle;height:auto;margin:10px auto; "/>

Debug program

You can use the ' debug options ' in the upper right corner of the screen to debug anywhere in the program.

If you are developing a graphical application, you can click on the ' Green button ' to run the program, and you can also run the program via the ' SHIFT+F10 ' shortcut key.

To debug the application, you can click on the green arrow next to the ' green button ' or press ' shift+f9 ' shortcut key. You can click on the gray edge of a line of code to set breakpoints so that when the program runs to this line of code it will stop.

You can run the code by pressing ' F8 ', which means you just run the code but can't get inside the function, and if you want to get inside the function, you can press ' F7 '. If you want to return from a function to the calling function, you can press ' Shift+f8 '.

During debugging, you will see many windows at the bottom of the screen, such as the list of processes and threads, and the variables you are monitoring.

When you run to a line of code, you can monitor the variables that appear in this line of code so that you can see when the value of the variable changes.

Another good option is to run the code using the Overwrite checker. The programming world has changed a lot over the years, and it is now common for developers to test-drive development so that they can check every change made to the program and ensure that it does not break another part of the system.

The Overlay checker is a good way to help you run a program, perform some tests, and, after the run is finished, tell you how much code the test run covers in terms of percentage.

There is also a tool to display the name of a class function or class, and the number of times an item is called and the time it takes to run a particular code fragment.

Code refactoring

Pycharm A very powerful feature is the code refactoring option.

When you start writing code, a small marker appears at the right edge. If you write code that may be wrong or not well written, Pycharm will mark the last color tag.

Clicking on the color tag will tell you the problem and provide a workaround.

For example, if you import a library with an import statement, but you don't use anything from that library, not only will this line of code be grayed out, but the color tag will also tell you ' the library is unused '.

For the correct code, you may also get an error message, such as there is only one blank line between the import statement and the start of the function. It also prompts you when you create a function that has a name other than lowercase.

You don't have to follow all the rules of Pycharm. Most of these rules are just good coding guidelines, regardless of whether your code works correctly.

The Code menu also has other refactoring options. For example, you can do code cleanup and check for file or project issues.

Summarize

Pycharm is an excellent editor for developing Python code on Linux Systems and has two versions available. The Community edition is available to temporary developers, and the Pro Edition provides all the tools that developers may need to develop professional software.


–pycharm Introduction to integrated development environment under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.