Feature Spotlight: Python Debugger and ‘Attach to Process’

Happy Friday everyone,

Today I’d like to highlight some recent changes and improvements in PyCharm`s Python debugger and explore the brand new attach to process in more detail.

Previously PyCharm used a special fork of the PyDev debugger with some PyCharm-specific changes, as well as our own unique features like GEvent debugging and breakpoints at Django templates. Before releasing PyCharm 4, we decided to contribute to open-sourced software and merged our debugger code with that from the original PyDev repository. Now the work on the debugger continues from both sides (PyCharm and PyDev) in one place. The merged source code now lives at https://github.com/fabioz/PyDev.Debugger and pull requests are greatly appreciated!

As a result of the unification and the work done since PyCharm 3.4, the debugger in PyCharm 4 has grown more powerful. We’ve added the Referring Objects view, Jinja 2 templates debugging, and other small improvements. Still, the most notable debugger feature introduced in PyCharm 4 is attach to process.

Using this feature you can connect the PyCharm debugger with any running Python process and debug in the attached mode.

Note: ‘Attach to Process’ functionality is available in both PyCharm Community Edition and PyCharm Professional Edition starting with v4.0. This feature is supported on all Windows, Linux and Mac platforms.

Let me show you how it works.

Say we have some long running application that we want attach to. In my example I’ll use a simple graphical Minecraft-inspired application that I found on GitHub.

I have opened the project in PyCharm and launched it using standard run/debug configurations:

1

The project is running, so now I can attach the debugger to it. For that I go to Tools and select Attach to Process. PyCharm shows the list of running Python processes in our system. I select the Minecraft process and click OK:

2

PyCharm automatically shows the debugger console with the message that the debugger has successfully connected to the process:

3

From this point on, debugger works in the attached mode. Let’s make use of it and stop at some line of code. To do that, in the editor I put a breakpoint on the line with some reachable code. In my example I’ve put the breakpoint on the line containing the definition of the cube_vertices function, which is being called a lot. In a few seconds, once the process reaches the breakpoint, PyCharm will stop at the breakpoint and show us the debugger with frames, variables and watches views:

4

Now we can use the debugger as usual – stepping into/over, pausing and resuming the process, evaluating variables and expressions, and changing the runtime context:

5

That’s it! Hopefully you’ll appreciate this addition to the new joint-effort PyCharm debugger, along with other handy features introduced in the latest version of PyCharm.

And if you’re craving for yet more details on PyCharm debugger, see this tutorial or the online help.

See you next week,
Dmitry

Posted in Cool Feature | 6 Comments

‘Best Interactive Programming Course with Python’ Contest in Full Swing

A month ago we announced the launch of the educational contest for the Best Interactive Programming Course with Python. A number of participants have already joined, but with 3 more weeks to go until the end of the contest there’s still plenty of time to make your contribution. There are multiple prizes in several categories, so why not give it a shot?

contest1

Register your entry on the contest page today. Then, create an awesome interactive programming course, submit it before February 28th, and win valuable prizes!

The theme of the contest is PROGRAMMING EDUCATION WITH PYTHON. This is just a general guideline, so use your imagination to create your own unique course. You can build any course as long as it’s educational and involves programming with Python! The rules, possible course ideas, registration form, detailed instructions, tutorials and other helpful materials are all there on the contest page.

The process is pretty simple:

  1. Register on the contest page today. We won’t publish your entry details anywhere, but we will use them for two things: to send you a reminder a few days before the end of the contest, and to check-out your course from the registered repository.
  2. Create an interactive programming course with Python and PyCharm Educational Edition. Recommended topics, rules, instructions and tutorials can be found here.
  3. Place your course in the public Git repository you entered during registration.
  4. Contest ends 23:59, February 28th—that’s the final deadline. That’s when we’ll collect all courses from all repositories for assessment and scoring. The scoring criterias are described in the Rules section on the contest page.
  5. Finally, the winners will be announced March 5th!

That’s it! Dive in now and get your entries in before February 28th!

Best of luck, and most importantly, have fun!
- PyCharm Team

Posted in Conferences & Events | Leave a comment

Design a Python Programming Course and Win!

The JetBrains PyCharm team is thrilled today to announce the start of the Interactive Programming with Python educational contest!

pycharm_contest

This is a great chance for teachers and instructors all around the globe to show their experience and skills in creating a programming course that thousands of learners will use.
The theme of the contest is PROGRAMMING EDUCATION WITH PYTHON. This is just a general guideline, so use your imagination to create your own unique course. You can build a basic introductory Python programming course, a bioinformatics algorithms course, an advanced data mining course, or anything else—as long as it’s educational and involves programming with Python. Get your creative juices flowing, develop the best interactive course, and compete for valuable prizes!

First, register in the contest, either as a team or an individual. You’ll have about 2 months to develop your programming course and submit your entry. Entries will be judged on a range of criteria accessible to different educational approaches and topics, so don’t be afraid to dive in!
In addition to being a fun competition, this contest is meant to encourage people to start teaching and learning programming using Python and PyCharm. Anyone who feels like creating an exciting and useful interactive programming course can and should take part!
As a known supporter of different educational programs, JetBrains is sponsoring this contest with valuable prizes. For more details on the conditions, rules and prizes please see the contest webpage, where you can also submit your entry.

Best of luck, and have fun!

Posted in Conferences & Events | Tagged , | 1 Comment

Announcing the PyCharm 4.0.4 release update

As the first week of the New Year 2015 is almost gone, PyCharm team is excited to present the first PyCharm update of this year – PyCharm 4.0.4 build 139.1001.

This update contains a lot of improvements: IPython Notebook integration, the debugger, the embedded local terminal, Git and Subversion support, resolve of class references, Lettuce support, CSS support – all this have got our attention.

Also there is one small but handy feature. If you open a Python console tool window and would like to have more then one consoles there, now there is a special button just for that:

multiple_consoles

The full list of all the fixes and improvements is available in the release notes.

As usual, please report any problem you have to our issue tracker.

If you would like to discuss your experiences with PyCharm, we look forward to your feedback on our PyCharm Facebook page and twitter.

Develop with Pleasure!
-PyCharm team

Posted in Release Announcements | 6 Comments

PyCharm 4.0.4 RC is available

2014 has been a massive year for PyCharm, thanks both to the team and our amazing users whose valuable feedback and input always plays an instrumental role in the development process. And as the year draws to a close, we’re glad to give you the last build of 2014, the PyCharm 4.0.4 Release Candidate.

This update includes significant bug-fixes for IPython Notebook integration, the integrated debugger, the embedded local terminal, and VCS support (mainly for Git and Subversion). One more notable bug-fix is the unresolved attribute references of a class.

PyCharm 4.0.4 also introduces one small but handy feature: multiple Python consoles. If you open a Python console, there is a new icon to open an additional one:

multiple_consoles

For the full list of fixes and improvements, see the release notes.

Download PyСharm 4.0.4 RC for your platform from the project EAP page. Do report any bugs you may find, or any feature requests you may have, to our Issue Tracker. This build will also be available shortly as a patch update from within the IDE. To take advantage of that, make sure to select the Beta Releases channel in your update settings.

Wishing you a Happy New Year on behalf of the entire PyCharm team!
See you again next year!

Posted in Early Access Preview | 4 Comments

Take (or design!) Programming 101 with PyCharm Educational Edition 1.0.1

Today we’re making publicly available a new version of our free, easy and professional tool for learning programming with Python. Please welcome PyCharm Educational Edition 1.0.1!

If you haven’t checked this tool out, learn how it helps novice programmers with little or no previous programming experience to learn programming with Python easily and effectively.

A couple of months ago we announced the first version of PyCharm Educational Edition. Thousands of downloads and heaps of valuable feedback have poured in since then. We did our best to use this input and insight to improve the tool.

The most notable improvement in v1.0.1 is the Introduction to Python learning course, which is available out of the box right after you install the tool:

welcome

It’s pretty simple to go through the default learning course in PyCharm—just follow this tutorial or watch this short demo. Anyway, we’ve enhanced this introduction course to make it much more intelligent and provide many new smart interactive checks, hints and suggestions, and better task descriptions and texts:

check

Another useful improvement in PyCharm Educational Edition 1.0.1 is that now you can always interrupt the task check. This is useful if your code hangs for some reason. For example here is a solution that results in an infinite loop and hangs the task check:

hangs

Simply click the Cancel icon and try solving the task again:

hang2

When jumping between answer placeholders, now it’s possible to edit them right from the cursor position (whereas previously the whole placeholder would get selected):

selections

If an error occurs while solving a task, now you can navigate to the place in the code where the error is found:

navigate

There are many other minor improvements in this release, so we encourage you to download and try it yourself! Unfortunately there will be no patch update from previous PyCharm Educational Edition v1.0 so please re-install PyCharm manually.

As a reminder, teachers, instructors and course authors can also use PyCharm Educational Educational Edition to create their own courses and share them with their students or with thousands users of PyCharm Educational Edition all around the globe. Read more about how this works and see the complete tutorial for course authors on how to create your own interactive course. Or, for a quick visual overview, watch this video:

Don’t wait any longer—download PyCharm Education Edition 1.0.1 for your platform and start learning (or teaching) Python programming today!

Other fun things you can do:

  • Spread the word about this tool
  • Follow us on twitter
  • Report bugs in our public issue tracker
  • If you ever need help, you’re always welcome to contact our professional support team
  • Read our blog to stay tuned for news, updates and everything that goes on with PyCharm Educational Edition. And do give us feedback on how we’re doing!

Develop with pleasure!
JetBrains PyCharm Team

Posted in Release Announcements | 7 Comments

Announcing the PyCharm 4.0.3 release update

Today we’re happy to announce that the PyCharm 4.0.3 bug-fix update has been uploaded and is now available from the download page. It also will be available in short time as a patch update from the previous versions of PyCharm 4.x.

This update includes the same set of major changes and fixes as the PyCharm 4.0.3 RC build. As a recap, some notable highlights of this release include:

  • a fix for a UI bug with find action
  • a fix for a remote debugger hanging
  • a fix for color settings in an embedded terminal
  • a test runner for Django nose tests is also fixed

For further details on the bug fixes and changes, please consult the Release Notes.

As usual, please report any problem you found in the issue tracker.

If you would like to discuss your experiences with PyCharm, we look forward to your feedback on our PyCharm Facebook page and twitter.

Develop with Pleasure!
-PyCharm team

Posted in Release Announcements | 3 Comments

Feature Spotlight: TextMate bundles in PyCharm

Happy Friday everyone,

Today I’m going to shed some light on how to get syntax highlighting for unsupported languages and file types in PyCharm.

As you probably know, PyCharm supports only a limited number of languages and technologies. PyCharm supports them with intelligence that appears in code completion, smart navigation, refactorings, inspections, and suggestions. But sometimes you might need to edit some project-specific files of an unsupported file type. In PyCharm you can open any file and edit it right away, but it always helpful to get at least syntax highlighting for it. Thanks to the TextMate bundles support you can get syntax highlighting for a wide range of languages.

Let’s see how to enable highlighting for an unsupported language in PyCharm. For example, in your project you might have some shell scripts – PyCharm doesn’t support the Shell language by default, however there is a TextMate bundle available for it:

shell

Here is a few simple steps you take to enable the highlighting for the Shell language inside PyCharm:

1. First go to Settings (Preferences for Mac OS) and make sure that the “TextMate bundles support” plugin is installed and enabled:

plugin

2. Download a TextMate bundle. In my example I use the shellscript TextMate bundle from the official TextMate GitHub repo.
3. Open Settings again and go to Editor | TextMate Bundles:

settings

4. Click “+” and locate the bundle on your filesystem. After that the bundle appears in the list of recognized bundles:

selected

5. From this point you just need to click OK and enjoy the new syntax highlighting in the editor:

colored

That’s it! However, lets hold for a while and consider some additional settings you might want to adjust.
The first thing you’ll probably want to change is a syntax coloring scheme. This can be done in Settings | Editior | Textmate Bundles:

colorscheme

The second thing you’ll probably need is to adjust file types associations. For that go to Settings | Editor | File Types and choose the “Files supported via TextMate bundles” option.
Here you can modify the list of registered filename patterns and the ones that are ignored:

filetypes

Hope this post helps!
See you next week.

-Dmitry

Posted in Cool Feature | 5 Comments

PyCharm 4.0.3 RC is available

Today we’ve published the PyCharm 4.0.3 RC bug-fix update.

Release notes lists all fixes from the previous PyCharm 4.0.2 update. The most notable among them are: a fix for a UI bug with find action, a fix for a remote debugger hanging, a fix for color settings in an embedded terminal, a test runner for Django nose tests is also fixed.

Download PyСharm 4.0.3 RC for your platform from the project EAP page and please report any bugs and feature request to our Issue Tracker. It also will be available shortly as a patch update from within the IDE. Make sure you’ve selected the Beta Releases channel in update settings.

Develop with Pleasure!
-PyCharm team

Posted in Early Access Preview | Leave a comment

Announcing the PyCharm 4.0.2 release update

Today we’re glad to announce the immediate availability of the PyCharm 4.0.2 update.
It’s already available for download from our website. It also will be available soon as a patch update from within the IDE (from PyCharm 4.x only).

As a recap, the most notable fixes in PyCharm 4.0.2 are: significant bug fixes for the integrated debugger and the django test runner, a number of bug fixes for VCS support (chiefly for Git) , improved template languages auto-detection, a fix for a problem with a Python console for remote interpreters, a fix for debugging of PyQt5, fixed Shift+Enter for the Run Django manage.py task.

For further details on the bug fixes and changes, please consult the Release Notes.

As usual, please report any problem you found in the issue tracker.

If you would like to discuss your experiences with PyCharm, we look forward to your feedback on our public PyCharm forum and twitter.

Develop with Pleasure!
-PyCharm team

Posted in Release Announcements | 5 Comments