Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hidden features of PyCharm [closed]

Tags:

python

pycharm

People also ask

How do I use PyCharm like a pro?

Skip memorizing keyboard shortcuts and speed search for actions instead. Save space by turning off various toolbars and Project Tool. Save space and stay keyboard-centric by turning off the tabs. Use Recent Files to quickly jump to last-visited file.

How do I ignore a warning in PyCharm?

Disable inspectionsIn the Settings/Preferences dialog ( Ctrl+Alt+S ), select Editor | Inspections. Locate the inspection you want to disable, and clear the checkbox next to it. Apply the changes and close the dialog.


As the lead developer of PyCharm, I can tell you that we don't usually hide features in random places, and there are a few reliable ways to discover most of them.

  • Try Ctrl-clicking on everything (methods, functions, template tag names and parameters, etc.)
  • If Ctrl-clicking works, usually so does completion (Ctrl-Space), rename (Shift-F6) and Find Usages (Alt-F7)
  • Look through the menus and try out the actions that seem interesting
  • Look at Settings | Inspections to configure the warnings which can be highlighted by PyCharm, and note that many of the inspections have quickfixes to correct the problems automatically
  • Read the blog and try out the features highlighted there.

I have recently discovered an option (I think it's off by default):

Surround selection on typing quote or brace

Basically if you can quickly make a string from anything, just press Ctrl-W to select and then type quote. Awesome :)

PS: To enable this use settings search function, search for: surround


I like ctrl-w, the select block function. I've never ran across this before I think it's great to be able to select a function/if block by just pressing ctrl-w a couple of times.


This isn't PyCharm specific, I actually discovered it in IntelliJ but I though the PyCharm users should benefit too...

Try Alt+Click (Ctrl+Alt+Click if using Gnome default keymap) and drag to select text. It will select bounded blocks instead of complete lines using word wrap. These selected blocks can be used to type repetitive text or delete many parts of a line at once. Try it, you will find uses for it more often than you think!


I don't know if this is a hidden feature really but when you know about it makes testing so much easier.

If you run your tests through PyCharm you can click on the names and lines of the backtrace to take you to the exact line in your python code. Makes testing so much easier.


Control-clicking a view method in a URLconf will open views.py and bring you right to that method. Similarly, control-clicking template names in a view, and in other templates (like in the extends tag) will bring you to that template.

Not hidden, but when editing a CSS file, it shows the colors in the gutter for any styles that use color. I love that. Also for CSS: code insight offers optimizations of tags, as well as graying out unused tags.

When editing an HTML file, moving the mouse towards the top-right of the editor will display icons for several browsers...clicking those will open the current HTML in the respective browser. Not as useful if you're using Django templates, but another piece of IDE-candy nonetheless.

Auto-import is also probably one of my favorite features. It still needs a bit of work, though. This is just a preview release, so I'm sure it'll continuously get better.

Well done, JetBrains!


Something I recently had to figure out was how to pass hardcoded arguments to a Python program when running it. I wanted to do it in the IDE rather than having to switch back and forth to a command window to run the program.

In PyCharm 1.5.2, you can click on Run, then Edit Configurations. The third textbox from the top, labeled Script parameters, allows you to hardcode program parameters. These will be used each time the program is run from PyCharm.