banner



How To Set Python Path In Pycharm

People celebrating

Learn the keyboard shortcuts!

As demonstrated in the previous section, PyCharm tin can be a very powerful IDE. It is important to note, however, that its ability is constrained by the competence of the user. If used expertly, it can save huge amounts of time. When used by a beginner, information technology can seem unnecessarily complicated and actually has the potential to slow yous downward.

I can highly recommend dedicating a twenty-four hour period or two (or iii) to simply learn the ins and outs of PyCharm (or indeed another IDE). If yous take the time to become an expert user, you will be much more efficient and productive in the long run!

One of the things that yous can become skillful in is keyboard shortcuts. Learning as many keyboard shortcuts as possible enables yous to work quicker because you don't take to take your easily off the keyboard!

A comprehensive list of PyCharm keyboard shortcuts is bachelor here for macOS and here for Windows, but I've highlighted a few of of the most commonly used ones beneath:

  • : opens the search window, from which you can type any file proper noun in your project to find and open a file.

  • E (macOS) or ^ Eastward (Windows): open a file from the list of recently opened files.

  • / (macOS) or ^ / (Windows): comment out/in the line of code where the cursor is, or the lawmaking that is currently highlighted.

The keyboard shortcuts described in a higher place are a very, very modest snapshot of all of the shortcuts that are bachelor to y'all in PyCharm. My communication is to give them a endeavour, and so practise using them until you lot have memorized them and they become 2d nature! Then get-go investigating and learning all the other shortcuts out in that location - you lot'll be able to code a lot faster!

Customize your project and editor

There are a lot of different ways that you can customize PyCharm to improve your lawmaking editing feel. The best place to offset is in the Preferences section. To open Preferences, go to PyCharm -> Preferences, or use the keyboard shortcut command/ctrl + ,.

PyCharm preferences.

Once within Preferences, the globe really is your oyster! Yous could go to Editor -> Font to change the font, font size and line spacing:

Changing font styles in PyCharm.
Changing font styles in PyCharm.

Another setting which people frequently tweak is the Color Scheme. Upwards until this point yous might take been thinking, Why isn't my PyCharm blackness? When you install PyCharm the default Color Scheme is Archetype Low-cal. I prefer to use the Darcula Colour Scheme. To modify this setting and encounter which Color Scheme y'all like best, go to Editor -> Color Scheme:

Setting the PyCharm Color Scheme.
Setting the PyCharm Color Scheme.

The Classic Lite color scheme looks more than like this:

PyCharm with the Classic Light Color Scheme.
PyCharm with the Archetype Light Colour Scheme.

Another powerful characteristic of PyCharm preferences is the power to search for particular settings. I like to alter the position of the visual guides in the editor, but can never think where they vest in the settings. Instead, I simply search for 'margin' in the preferences search box:

Configuring the PyCharm margin.
Configuring the PyCharm margin.

From here, you can set the 'Visual Guides' setting to99  . This then gives you lot a visual guide in your editor when your line of code reaches99   characters in length (a common setting for Python linters/syntax checkers):

PyCharm with a margin.
PyCharm with a margin.

Employgit  with PyCharm

If you are already familiar with usinggit   to manage version control on your projects, so it is worth experimenting with integrating PyCharm withgit   to manage your version command. If you aren't familiar withgit   and then don't worry - you tin can gloss over this section!

In that location are essentially iii ways of managing version command withgit  :

  • Using the command line in the terminal.

  • Using agit   GUI customer such as GitKraken or Github Desktop.

  • Usinggit   in your IDE.

We are going to explore the terminal choice, usinggit   as part of your IDE.

Open PyCharm CE from scratch, simply instead of choosing 'Open' or 'Create New Project', choose 'Get From Version Control':

The PyCharm welcome screen.
The PyCharm welcome screen.

Now, choose the 'GitHub' pick and enter your GitHub username and password and click on 'Login':

Connecting PyCharm to GitHub.
Connecting PyCharm to GitHub.

When you accept successfully authenticated with GitHub, you will be presented with a list of all of the GitHub repositories that you either own or take admission to. I won't share mine for security reasons, simply you can choose whatsoever of your GitHub repositories, choose a directory where you want to store the repository locally and click on 'Clone'.

In one case you have done this, PyCharm will create a new projection with the lawmaking in your repository, and the repository will be available in the project tree sidebar equally earlier:

PyCharm project tree.
PyCharm projection tree.

In addition to this, a new piece of functionality will also appear in PyCharm. In the bottom left corner you should now see agit  option:

PyCharm with a 'git' option.
PyCharm with a 'Git' pick.

Click on the Git option to come across the Git window:

The PyCharm Git window.
The PyCharm Git window.

Inside thegit   window y'all have all of thegit   functionality that you normally have at your fingertips on the command line in concluding or using yourgit   client. For example, you can:

  • Create new branches and checkout branches.

  • View and interrogate thegit  log.

  • Much, much more!

The 'Commit' section on the left-manus side also allows y'all to add files to thegit   staging area and commit them every bit part of your normal workflow:

The PyCharm 'Commit' option.
The PyCharm 'Commit' choice.

The full power of usinggit   within PyCharm is well beyond the scope of this course, but you should explore it more to help you brand an informed determination equally to whether you would like to: a) employgit   via the command line in final, b) use agit   client, or c) applygit   within PyCharm.

Let's Recap!

  • PyCharm can exist configured and customized in lots of different ways - information technology is well worth exploring the Preferences section to brand sure that you get the best out of your IDE.

  • To make sure you are using PyCharm efficiently and effectively it is worth taking some time out to learn keyboard shortcuts. Although information technology might deadening you down slightly to brainstorm with, information technology will definitely be worth information technology in the long run!

Congratulations - y'all are at present a power user on PyCharm! Don't forget to try out your new skills in using an IDE by completing the final quiz.

Source: https://openclassrooms.com/en/courses/6900846-set-up-a-python-environment/6991012-power-up-pycharm

0 Response to "How To Set Python Path In Pycharm"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel