Use of an IDE Pycharm the Python

Use of an IDE Pycharm the Python

First, why use IDE (Python Integrated Development Environment -Pycharm)

Until now, we are people wrote code for you, but you have not found a time to write code to create a new file, but also save selected storage location when finished, but also switch to the command line execution when calling python interpreter, good trouble ah, can one go, let me simply write the code? IDE development tools at this time to play it, a good IDE can help you greatly enhance the development efficiency.

Many languages ​​have more popular development tools, such as the JAVA Eclipse, C #, C ++ of VisualStudio, Python is Shane? Pycharm and Jupyter, two of the best Python development IDE.

Second, the installation PyCharm (Laohantuiche formula)

Next, install pycharm

1, first download pycharm from the site: Click to open the link (link to: http://www.jetbrains.com/pycharm/download/#section=windows ), then enter the following chart, choose according to their computer's operating system, for windows system selection area shown in red circle.

Pycharm the 012-Python integrated development environment of use -01.png? X-oss-process = style / watermark

2, in the pop PyCharm installation welcome page, click "Next button" to enter the next step

Pycharm the 012-Python integrated development environment of use -02.png? X-oss-process = style / watermark

3, depending on your computer's processor to select 32-bit or 64-bit, create a desktop shortcut, associate * .py file

Pycharm the 012-Python integrated development environment of use -03.png? X-oss-process = style / watermark

4. Select the Start Menu folder, select Install

Pycharm the 012-Python integrated development environment of use -04.png? X-oss-process = style / watermark

5, start the installation

012-Python集成开发环境之Pycharm的使用-05.png?x-oss-process=style/watermark

6, the installation is complete, run Pycharm immediately

012-Python集成开发环境之Pycharm的使用-06.png?x-oss-process=style/watermark

7, choose whether to import the development environment configuration file, here choose not to import

012-Python集成开发环境之Pycharm的使用-07.png?x-oss-process=style/watermark

8, read and accept these Terms and Conditions, no doubt, decisive accepted

012-Python集成开发环境之Pycharm的使用-08.png?x-oss-process=style/watermark

9, License: Software activation

  1. Recommended to buy legitimate software, support genuine.
  2. You can choose to download the community version, free of charge, this version can play white
  3. Professional version can choose to try, free 30-day trial.
  4. Looking for activation code online or authorization server.
  5. Everything a treasure ah! It gave me strength.

2.1 brute Pycharm get an activation code

在此使用第4种方法,建议先把“0.0.0.0 account.jetbrains.com”添加到hosts文件中,一般在C:\Windows\System32\drivers\etc目录下,若没有,动动小手新建一个,注意无后缀名

012-Python集成开发环境之Pycharm的使用-09.png?x-oss-process=style/watermark

修改hosts文件,在最后添加黄色标记部分,即0.0.0.0 account.jetbrains.com,并保存:

012-Python集成开发环境之Pycharm的使用-10.png?x-oss-process=style/watermark

此处通过http://idea.lanyus.com/,获取激活码,并复制

012-Python集成开发环境之Pycharm的使用-11.png?x-oss-process=style/watermark

012-Python集成开发环境之Pycharm的使用-12.png?x-oss-process=style/watermark

10、粘贴注册码到下图紫色框框里,点击OK即可。

012-Python集成开发环境之Pycharm的使用-13.png?x-oss-process=style/watermark

11、漂亮的原谅色界面就出现了

012-Python集成开发环境之Pycharm的使用-14.png?x-oss-process=style/watermark

12、点击创建新项目

012-Python集成开发环境之Pycharm的使用-15.png?x-oss-process=style/watermark

13、自定义项目存储路径,默认关联Python解释器,点击Create

012-Python集成开发环境之Pycharm的使用-16.png?x-oss-process=style/watermark

2.2 汉化Pycharm

注意:汉化前请关闭PyCharm,并且作为高贵的开发的你,尽量不要使用

14、汉化包获取:https://pan.baidu.com/s/1sweHYIyiA_gZR7XoMaBTXw

012-Python集成开发环境之Pycharm的使用-17.png?x-oss-process=style/watermark

15、将汉化包”resources_cn.jar”放置到安装目录的lib下,重启PyCharm

012-Python集成开发环境之Pycharm的使用-18.png?x-oss-process=style/watermark

三、使用Pycharm

3.1 整体结构

012-Python集成开发环境之Pycharm的使用-19.jpg?x-oss-process=style/watermark

3.2 使用技巧

1、如何更换Python解释器:

在文件->设置->项目:xxx下找到Project Interpreter。然后修改为你需要的Python解释器。注意这个地方一定要注意的是:在选择Python解释器的时候,一定要选择到python.exe这个文件,而不是python的安装文件夹。

012-Python集成开发环境之Pycharm的使用-20.jpg?x-oss-process=style/watermark

2、如何创建一个Python包:

012-Python集成开发环境之Pycharm的使用-21.jpg?x-oss-process=style/watermark

注意:**一定要选择Python Package,不然就不会创建一个__init__.py文件。否则需要自己创建。**

3、如何创建不同类型的文件:

012-Python集成开发环境之Pycharm的使用-22.jpg?x-oss-process=style/watermark

4、 如何新建一个项目:

012-Python集成开发环境之Pycharm的使用-23.jpg?x-oss-process=style/watermark

5、如何调整编辑器字体及其大小:

012-Python集成开发环境之Pycharm的使用-24.jpg?x-oss-process=style/watermark

6、如何调整控制台的字体及其大小:

012-Python集成开发环境之Pycharm的使用-25.jpg?x-oss-process=style/watermark

7、如何设置文件编码:

012-Python集成开发环境之Pycharm的使用-26.jpg?x-oss-process=style/watermark

8、如何修改文件背景颜色:

012-Python集成开发环境之Pycharm的使用-27.jpg?x-oss-process=style/watermark

9、如何让一个tab键代替4个空格键:

012-Python集成开发环境之Pycharm的使用-28.jpg?x-oss-process=style/watermark

10、如何自定义Python模版文件:

012-Python集成开发环境之Pycharm的使用-29.jpg?x-oss-process=style/watermark

11, display line numbers: display the line number in the right place, check the display line numbers.

12, install plug-ins: Settings -> Plugins-> Browse repositories, then enter your plugins are installed.

13, copy the file path: Right -> copy path.

14, open File Manager: Right -> Show In Explorer.

15, into a file in which: the cursor in the middle of a word, and then press ctrl + B + ctrl key or press the left mouse button.

16, see the project structure

012-Python集成开发环境之Pycharm的使用-30.jpg?x-oss-process=style/watermark

17、DEBUG:

Skip function is executed

012-Python集成开发环境之Pycharm的使用-31.jpg?x-oss-process=style/watermark

Enter your own functions into the system function

012-Python集成开发环境之Pycharm的使用-32.jpg?x-oss-process=style/watermark

Enter your own functions, but does not enter the system function

012-Python集成开发环境之Pycharm的使用-33.jpg?x-oss-process=style/watermark

Out of a function currently executing

012-Python集成开发环境之Pycharm的使用-34.jpg?x-oss-process=style/watermark

Place the cursor jumps

012-Python集成开发环境之Pycharm的使用-35.jpg?x-oss-process=style/watermark

Skip to the next breakpoint

012-Python集成开发环境之Pycharm的使用-36.jpg?x-oss-process=style/watermark

The end of this execution

012-Python集成开发环境之Pycharm的使用-37.jpg?x-oss-process=style/watermark

18, only one instance provided disposable

012-Python集成开发环境之Pycharm的使用-38.jpg?x-oss-process=style/watermark

19, commonly used shortcuts

  • ctrl + c: Copy selection; when you do not select content, copy the current line.
  • ctrl + x: Cut the selected text; when the content is not selected, the current line.
  • ctrl + v: Paste
  • ctrl + d: Copy the current line to the next line.
  • ctrl + y: delete the current row.
  • shift + enter: skip to the next line.
  • ctrl + /: add comments.
  • tab: indentation.
  • shift + tab: un-indent.
  • ctrl + f: Find.
  • ctrl + shift + r: look in the current project.
  • minus ctrl +: folding the current code block.
  • ctrl + Plus: Expand the current code block.
  • minus ctrl + shift +: folding the current file all code blocks.
  • ctrl + shift + plus: Expand the current file all the code base.
  • ctrl + z: go back operation
  • shift + ctrl + z: Back Next

Guess you like

Origin www.cnblogs.com/randysun/p/11710635.html
Recommended