Pycharm Use Introduction __ Other

Source: Internet
Author: User

Recently, as a result of the project needs, the leader asked to use Python to facilitate expansion, there is no way, spot spent 2 days to turn over Python's primary tutorial and then began to write code. With a good IDE to help me get started on a new language quickly, here's a pycharm python IDE.

1. Installation and first use

Pycharm is one of the most convenient Python editors I've ever used. And can be cross-platform, under MacOS and Windows can be used, this is better.

First preview the Pycharm in the actual application of the interface: (changed the pycharm default style)



1.1 Installation

First download the latest Pycharm 2.7.3 for installation. Can be downloaded directly from the website.

how the Pycharm is activated:

1, recommended purchase genuine .

2, you can choose trial, free trial for 30 days.

3, find the Activation code online:

(The following activation code comes from the Internet, for learning and communication only)

User name: Embrace

Key
14203-12042010
0000107iq75c621p7x1sfnpjdivknx
6zcwyoyagk3euo3ehd1mitt "2! Jny8
BFF9VCTSJK7SRDLQKRVZ1XGKBMQW3G 1.2 First Use

1, click Create New Project.


2, enter the project name, path, and choose the Python interpreter. If the Python interpreter does not appear, proceed to step 3.


3, select the Python interpreter. As you can see, once you've added the Python interpreter, pycharm scans out the Python extensions you've installed, and the latest versions of these expansion packs. (estimated to be pycharm connected to PyPI)


4, after clicking OK, an empty item is created that contains a folder of. Idea, which is used for pycharm management projects. 2. New Project 2.1 Create a new project

File--> New Project ...

2.2 Create a new file right-click the Helloword project you just built, and choose New--> Python file


2.3 input filename input filename, there's nothing to say

2.4 into the writing interface Pycharm's default editing interface is strange, and automatically generates a row of __author__ = "Author" headers. And more commonly used file headers, such as: #coding =utf-8, but not automatically generated.


Enter code:

Print "Hello word!"


2.5 Setting the console

Before running, we found that the "Run" and "Debug" on the shortcut menu are grayed out and cannot be triggered. Because we need to configure the console first.

Click the black inverted triangle next to the run to enter the "Run/debug Configurations" configuration interface. (or click Run--> Edit configurations)


In the "Run/debug Configurations" Configuration interface,

Click on the green plus sign, create a new configuration item, and select Python. (Because Hello Word is a python program)



In the configuration interface on the right:

Name in the column, say hello.

Click the SCRIP option to find what we wrote just now hello_word.py


Click OK to automatically return to the editing interface, this time the "Run" "Debug" button all turned green.

2.6 Run Click the Green Run button to see the results of the output:

3, breakpoint debugging 3.1. Set Breakpoints

In front of the code, after the line number, click the mouse and you can set the breakpoint. As follows:



3.2, Debug breakpoints click on the green beetle icon (it seems that the beetle has become the Debug special icon) for breakpoint debugging.

When clicked, the first breakpoint is run. The variable information before the breakpoint is displayed.


Click Step Over or press F8, we continue to run down to the next breakpoint:


Add:

Breakpoints of other operations, and functions, you can move the mouse to the corresponding button, look, try to know. As follows:




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.