Some PyCharm entry of new to Python use and set up suggestions!

PyCharm I strongly recommend Python IDE, if you have EDU mailboxes can apply directly to Pro license, or to use the community edition, functional and not much reduction in the daily development is also quite enough.

If this is the first installation PyCharm, there are some recommendations set or modified in accordance with their habits off, the so-called Preparation may quicken the work.

Show Toolbar

The default PyCharm not display the toolbar (Toolbar), in most IDE toolbars are put most common operations, you can through the main menu - Display - the menu bar to display the toolbar. After the toolbar is displayed you can also customize the button above right, I'll put some of the VCS with related operations into the above, such as Fetch, Push, Pull and by default it only added Commit.

Smart Tips Match case

Probably for reasons of language and dynamic performance, PyCharm code hinting default is case-sensitive. For example, you knock on bwill prompt you backbut will not prompt you BACK, quite frankly inconvenient, you can get rid of it. In settings where a search match casecan be adjusted.

Mouse wheel to adjust the font size

Sometimes we discuss or share code already set the font size may not be appropriate, or many IDE software is supported in real time using the mouse wheel to adjust the font size, PyCharm you need to manually enable this feature. In setting the search zoomyou can find the corresponding settings.

Modifying unit testing framework

If you have the habit of writing unit tests, surely must know pytest, PyCharm can be a good and a lot of well-known testing framework, but its default configuration is unittest, search in the settings testcan be adjusted to your common framework.

For example, after adjusting to pytest, as long as your method name prefix test_, then the IDE will prompt you that this is a test, the front will be more of a small triangle, let you easily run or debug.

PyCharm testing framework to support a lot, but my favorite was pytest.

Incidentally that, PyCharm can configure a custom similar, there are many, such as shell terminal used, the virtual environment tool of choice, Flask template language and so on. Do not understand the learning process can join our learning exchange Qiuqiu intermediate ring 784 758 214 back to share the moment Python enterprise talent needs and how Python from the zero-based learning with you, and learn what content. Related video learning materials, development tools have to share

Options before submitting code

Assuming you have the default display the toolbar, then submit the code after you only need to click the Commit button to the toolbar, which will pop up a dialog box where you can easily see the file you want to submit, you can freely diff, add, remove or even directly edit. Many times we find in the Gala Li diff some things always leak, turn off the diff when the general flow back to the editor, find the place to get rid of, in PyCharm the commit dialog, you can go, Shuangwai.

More powerful, you can also select the formatting before submitting the code to optimize import area and so on.

Other settings can be adjusted

  1. Appearance and Themes, including the editor font, background and so on.
  2. Shortcuts, if you can not remember it the default shortcut, then change you can remember.
  3. Some items hidden files, cure OCD. (Search settings "ignore files")
  4. Easily install their own plug-ins. (Search settings "plugins")

Some use the experience summary

Built-in well with VCS

Built-in Version Control provides all the functions needed for daily operations, but within reach, the key is very intuitive, unable to stop after using. It also provides changlist and shelvset feature that allows you to modify the temporary merger or submit not want to deal before the code, which is a lot of developers want.

Built-in command line tool very easy to use

IDE built-in command-line tool is actually a hard demand, many IDE beginning we see no need to, but you see now, you almost can not find a command line without the IDE. The most convenient place PyCharm with an IDE that can automatically identify items in the virtual environment and enable it, which is an external command-line tool can not match.

Very easy to use built-in Python Console

Write Python certainly can not do without instant interpreter, in PyCharm where you can readily use Python Console test code fragment, which not only provides smart tips, you can also view a running variable, and even drawing painting table, integrated iPython Notebook.

Modify the runtime state so cool

When you use PyCharm debugging code, you can see the operating variables directly in the Variables window, you can also directly modify the values ​​of these variables, more powerful, you can execute the statement directly, the same point that the calculator icon on the line.

This feature also has Visual Studio, called ImmediateWindow, can save you a lot of debugging time. However PyCharm less a Visual Studio in my favorite feature, drag the current breakpoint. Suppose the current stop breakpoint at line 40, VS can be in directly onto the first few lines, for example line 30, this code is run repeatedly artificially controlled.

Always create a virtual environment for new projects

Do not just write a number of projects with the default Python interpreter, 2 does not work, you'll regret it later. Create a new virtual environment in PyCharm just a few clicks, no trouble.

Import and export configuration is the most reliable

Earlier we said a lot of configuration options, if you have N machines are installed PyCharm, each have more than Leia reconfigure it again, especially if that is not the default shortcut keys, change the machine wants to weep.

PyCharm program provides a synchronization configuration, you can create an empty git repo, fill to Tools / Settings / Repository where you can automatically upload the configuration. Other machines are also configured the same, in theory, the cloud configuration is synchronized. But my experience tell you, this really does not fly, Mac and Windows and shift more than a few times confused, and want to cry ah. Fortunately, I have a plan B.

Plan B is simple, when a machine is configured, select the main menu - File - Export configuration. Exported configuration file is a jar, casually thrown into Evernote or nuts clouds, with a new machine in the main menu - you can import the configuration - file.

The difference between Community Edition and Professional Edition

I have just two versions in use, probably talk about something more out of Pro may be used.

  1. And Flask, Django deep integration, smart tips to surprise your level.
  2. Support for debugging multithreaded, providing performance optimization tool.
  3. Quick access and display unit test coverage.
  4. Integrated database tools, can be directly connected to any database in the IDE.
  5. Support Live Edit, allow you to edit the code at the same time, real-time display in the browser.
  6. Support for a key deployment docker.

Professional Edition is still very powerful, but also very expensive. Extra features very convenient, but not essential, you can select as appropriate.

Finally, I wish you all happy coding.

Guess you like

Origin blog.csdn.net/weichen090909/article/details/93783081