3 Quick Git “Show-Me” Videos From Our IDE Family

Git is a fantastic and wildly popular version control system. Once you get beyond the basics, though, it can be a bit cryptic for civilians. Fortunately, this is an area where JetBrains IDEs can help, by putting a visual face on the underlying git commands.

Our colleagues in PhpStorm and IntelliJ recently tried a fun new approach at showing this. Since Git/GitHub support is largely shared across all of our IDEs, why not do a series of task-oriented, bite-sized screencasts featuring two IDEs tackling a certain Git workflow? And since version control, like so many of our features, is shared across IDEs…why not share their first 3 videos with our PyCharm folks?

How do I switch branches without losing my work?

You’re in the middle of heavy development. Your work is on a branch, which is the way the gods intended. However, you need to do something else — fix a bug on the master branch, review someone else’s work on a branch, etc. But you can’t switch off of your branch when you have uncommitted work.

Rather than do a “maybe this works” commit, you have several choices. This bite-sized video shows Trisha and Gary in a real-world scenario, letting their JetBrains IDEs (IntelliJ and PhpStorm) put a friendly face on the operations. And remember, PyCharm is the same for version control as the other JetBrains IDEs. Items covered:

  • On a branch, in the middle of huge unfinished work porting to Php 7, but need to investigate a bug on that branch
  • Use the IDE’s shelve feature to move changes out-of-the-way, instead of committing
  • This restores the branch to its head state with no changes
  • Later, “unshelve” to re-apply the changes, possibly to a new branch

I often find myself in this pattern. For example, I’m working on some feature. I get a bee in my bonnet and do some unrelated work, get myself into a bind, and need to…do something. With this, instead of committing, I can get the work off the branch and into a place where it belongs.

How to Keep a Git Fork up to Date?

Forking on GitHub is a wonderful facility, allowing people to modify code and even submit improvements back, without being added as a contributor to the main code base. But once you’ve forked, how do you stay up-to-date with the original?

Gary and Trisha cover this, again using PhpStorm and IntelliJ to show:

  • A local checkout with two remotes — the “upstream” original and the “origin” containing the personal fork
  • Use fetch to non-destructively get a listing of the upstream’s changes, then a pull to get those changes from upstream into the local checkout
  • Push those upstream changes into your fork i.e. the “origin” remote

How Do I Start Working with Open Source and GitHub?

Of course these two videos presume you already have a project checked out and ready to go. But how do you get started with open source? How do you get a project on GitHub into a fork and into your IDE?

For both IntelliJ and WebStorm, Trisha and Gary show this in action:

  • Find an interesting project and fork it into your personal GitHub organization
  • Copy the URL for that fork and use it to start a new project in your IDE
  • Track the original by adding the repository URL for the “upstream” remote

Conclusion

These three videos tackle specific workflows related to Git. If you find this approach interesting and have a suggestion for another video, put in a comment on the YouTube page for one of the videos. In fact, the third video was selected based on an earlier comment.

Posted in Cool Feature, Screencast, Video | Tagged | 1 Comment

PyCharm 2017.1 EAP 6 (build 171.3019.3)

The sixth Early Access Program release of PyCharm 2017.1 is out now! Get it now from our EAP website

This week we’ve added these features:

  • Ctrl+Click on links to open them in the Terminal

And we’ve resolved the following bugs:

  • Execute selection/line in console
  • input() in debug console
  • Debugging Docker projects on Mac
  • SSH remote interpreter errors
  • Pyramid project creation with Chameleon templates
  • Many Angular2 fixes
  • Various other JavaScript formatting and inspections

Any improvements marked ‘Pro only’ are only available in PyCharm Professional Edition. You can use the EAP version of PyCharm Professional Edition for free for 30 days.

We’d like to encourage you to try out this new EAP version. To keep up-to-date with our EAP releases set your update channel to Early Access Program: Settings | Appearance & Behavior | System Settings | Updates, Automatically check updates for “Early Access Program”

We do our best to find all bugs before we release, but in these preview builds there might still be some bugs in the product. If you find one, please let us know on YouTrack, or contact us on Twitter @PyCharm.

-PyCharm Team
The Drive to Develop

Posted in Early Access Preview | Tagged | 7 Comments

Let’s Write a Game: Hangout with PyLadies Pune

In early January I was invited by PyLadies Pune to do a hangout. We spent an hour writing a 2d game in Python, covering a number of Python development skills along the way. I’d love to repeat this, so if you have a meetup or user group and are interested, let me know. The recording is below…let’s talk a bit about the backstory.

Smart, Nice, Energetic: Sounds Like Python

PyCharm visited PyCon India in September 2016 and, at our booth, tutorials, and talks, we were fortunate to meet many Python developers and hear about the community in India. So very much going on, and it was nice to see the PyCharm has interest as well. We did a PyCharm tutorial and a talk on using PyCharm for JS MVC web frontends.

We also had a chance to meet the people behind the reboot of the Pune chapter for PyLadies and sit in on a panel discussion they hosted about growing communities. The lesson I learned: pay attention to what they’re doing, as they are a smart group of people, warm and inviting hospitality, and sincere in their effort to bring people in.

Far Away, So Close

Based on that, I asked if I could remotely participate in one of their meetups. I realized this was an imposition based on timezones, and was pleased to get an invite for a Saturday morning hangout.

I thought a bit about what to show. I wanted to focus more on development skills, with the IDE helping along the way. I’ve been partially involved with Arcade, a Python library for 2d games. Games are always a fun topic, and Arcade is so lightweight that a 1 hour session doesn’t turn into 59 minutes of “learn Arcade”. This point is critical and quite easy to get wrong.

The outline was then straightforward, showing: running a Python program, version control, debugging, testing, coverage, and profiling. All from a “visual” (read: IDE) perspective. All in a bit over an hour.

Snow Falling on Cedars

The morning of, I woke up early to a blanket of snow, which made for a peaceful atmosphere for the hangout. I used YouTube On Air for Google Hangouts, which did a nice recording, but introduced approximately a 30 sec lag. This made it awkward to pause and ask for questions.

The recording is available on YouTube. Kushal Das did a nice writeup of the session, as did Pooja Yadav.

I’m hopeful to do more of these. If you have a user group and you’re willing to have a remote speaker, give me a nudge on Twitter. I can show this same outline, or a deeper dive on visual debugging, visual testing, JS MVC frontends, or some other crazy idea that you might have.

Posted in Screencast, Tutorial, Video | Tagged | Leave a comment

PyCharm 2017.1 EAP 5 (build 171.2822.19)

The fifth Early Access Program (EAP) release of PyCharm 2017.1 is available now. Get it from our website!

This EAP introduces several new features:

  • Support for the ‘six’ library. The six library is a tool for writing Python applications (or libraries) that support both Python 2 and Python 3
  • A faster debugger for Python 3.6, we’re using language features introduced in PEP 523 to make the debugging experience quicker
  • We’ve revamped our test runner, it now communicates with test frameworks using the TeamCity test protocol. This ensures that your unit tests will be run identically on your machine and on the CI server. The new runner enables a more consistent, and more debuggable testing experience. If you’d like to read more technical details, check out the confluence page our developer wrote
  • We’ve added a ‘Data View’ window, if you’re doing data science using PyCharm, you can now have an overview window with your Pandas DataFrames and NumPy Arrays.data_view
  • We’ve added the Google JavaScript style guide as a preset. Load it by going to Settings | Editor | Code Style | JavaScript, and then use the ‘set from’ link on the right to choose ‘Google JavaScript Style Guide’. [Pro only]google-js-style

We’ve also worked hard to fix bugs:

  • Many Pyramid bugs have been resolved: template language selection, run configuration issues, some exceptions, and last but not least we updated the logo. [Pro only]
  • Issues with Django test configurations [Pro only]
  • Jupyter Notebook issues

Any improvements marked ‘Pro only’ are only available in PyCharm Professional Edition. You can use the EAP version of PyCharm Professional Edition for free for 30 days.

We’d like to encourage you to try out this new EAP version. To keep up-to-date with our EAP releases set your update channel to Early Access Program: Settings | Appearance & Behavior | System Settings | Updates, Automatically check updates for “Early Access Program”

We do our best to find all bugs before we release, but in these preview builds there might still be some bugs in the product. If you find one, please let us know on YouTrack, or contact us on Twitter @PyCharm.

-PyCharm Team
The Drive to Develop

Posted in Early Access Preview | Tagged | 5 Comments

Life Without the Project Explorer

It’s an indisputable (alternative) fact that, since Before the Dawn of Time™, or at least since GUIs became in vogue, file explorers are an essential part of any programming tool. Gotta browse them trees. It’s impossible to imagine not having your directory browser open in something like PyCharm’s Project Tool.

Or is it? I recently took my boss Hadi’s challenge. Well, I took part of it. I closed my Project Tool window and used other ways to navigate my files. And I liked it. Here are ways to enjoy Life Without the Project Explorer.

Meet You at the Bar…Navigation, That Is

PyCharm’s Project Tool is visible by default. Let’s go cold turkey and close it by clicking its hide button .

If you don’t have the Navigation Bar visible, turn it on by selecting View -> Navigation Bar. You’ll see it appear on the first row inside your window. If you are in a deep hierarchy, you’ll see breadcrumb-like buttons, starting at the project root, all the way down to the currently-visible file:

Basic navigation bar

Basic navigation bar

Ok, let’s do some fun things. You want to open the file bouncing_ball.py in the examples parent. You simply click on examples in the Navigation Bar and select the file:

Opening a file via navigation bar

Opening a file via navigation bar

Hmm, we have a problem. The Navigation Bar is space-constrained, so it can’t show everything in the examples folder. You want to open the file zorder.py. That’s a problem. But hey, we’re PyCharm, we make solutions…in this case, speed search to the rescue. You just click on the target and start typing some letters of the filename, then the list is filtered:

Speed search in navigation popup

Speed search in navigation popup

Like all places where PyCharm filters lists, you can use CamelHump syntax for the search expression.

Opening files isn’t the only thing we use the Project Tool for. What about creating a file in a subdirectory? Yep, you can right-click, not only on a folder directly in the navigation bar, but also inside a folder in the popup:

Creating a file via navigation bar

Creating a file via navigation bar

The other context-menu operations are also possible. Here’s one I use constantly, Find in Path:

Find in Path in navigation bar and popup

Find in Path in navigation bar and popup

Hmm, here’s a tough one though. What if you want to browse and then open a file not in one of my parent folders. Ok, I lied, it’s easy:

Navigation alternate directory path

Navigation alternate directory path

That covers almost everything that I would have used the Project Tool for. What might you miss by using the Navigation Bar? You can’t re-organize via drag-and-drop. You can’t do anything that requires multiple selection. And while it show icons for types of files and even color-coding for VCS status, it doesn’t show coverage information.

Anything else I left off the list? Leave a comment and I’ll update this blog post.

The Navigation Bar is a nice first step away from the Project Tool window. If you want to go further and hide the Navigation Bar, what are some choices?

What Was I Just Doing?

Most of the time, I switch between a handful of files that I’m actively working on. The other hundred (or, in an npm-based project, trillion) files are in the “not urgent” pile. PyCharm has features that makes this workflow very convenient.

I’ll start with the one I use the most — Recent Files aka Ctrl-E:

Opening a recent file

Opening a recent file

Let’s say you’re editing some function, and you’re writing the test for that function. You’re switching back and forth. It’s very easy and non-disrupting: Ctrl-E then Enter — because the most-recent file is listed first and selected.

What if the file you want isn’t the first entry in the Recent Files popup? You could take your hands off the keyboard, grab your mouse, but you’ll hear the distant sounds of Hadi yelling “Go mouseless!” You could use the keyboard’s down arrow. Or…yep, as in all things, speed search to the rescue:

Speed search in recent items

Speed search in recent items

Recent Files also lets you navigate by mouse/arrow/speed search to tool windows. Want to get quickly to the terminal without using your mouse?

Speed search to terminal

Speed search to terminal

But maybe you just want the files you’ve recently edited, not visited. Recently Changed Files Shift-Ctrl-E might be the action/shortcut you use the most:

Recently edited files

Recently edited files

There’s one more…the leanest-meanest popup around: the Switcher at Ctrl-Tab. Or more specifically, Ctrl-Tab and keep holding Ctrl. The Switcher disappears when you let go of Ctrl. While it’s visible, move around with the arrow keys, or Tab/Shift-Tab to move forward/backwards in the listing and columns.

If you’re like me, these 3 choices are two too many. I currently make Ctrl-E and speed search my primary, don’t-make-me-think option.

This Tab’s On Me

It’s now confession time. I still use tabs. My last hurdle is, of all things, TDD. In Python and Angular 2, I try to write tests as I write my code, and it’s nice to see both. Though I think there’s one more level of TDD zen I can reach to eliminate even this need.

This article is by no means a harangue to tell you how to use your tool. I think tabs are ok. In fact, “highly visible tabs” was one of two things that finally made me switch from Emacs to PyCharm years ago.

At the same time, as you become more of a badass, and especially if you’re coming from a lean-and-mean editor background, you might find it appealing to turn off the Project Tool and use lighter-weight choices for navigation. A hybrid, as described in this article might be the shoe that fits your foot.

Posted in Cool Feature, Tutorial | Tagged | 19 Comments

PyCharm 2017.1 EAP 4 (build 171.2613.10)

We are happy to announce the fourth Early Access Program (EAP) release of PyCharm 2017.1. Download it now from our website!

In this EAP we’re introducing these features:

  • New code style options: you can now specify in more detail how you would like to arrange multiline imports (from package import a, lot, of, things). You can configure them in Settings | Editor | Code Style | Python | Wrapping and Bracesimport-code-style
  • If you’d like to follow a link in the terminal, double-click the link, right-click and select ‘Open as URL’. terminal_link
  • Types are now shown in parameter hints (press Ctrl+P to see them when your cursor is  between method call parentheses)

We’ve also fixed a lot of bugs:

  • Issues with multiple Django settings files [Pro only]
  • Django remote projects don’t sync newly created files [Pro only]
  • Editor bugs in scratch files have been resolved
  • Many JavaScript bugs have been resolved
  • Several Vagrantfile bugs [Pro only]
  • And more

Any improvements marked ‘Pro only’ are only available in PyCharm Professional Edition. You can use the EAP version of PyCharm Professional Edition for free for 30 days.

Download it now from our website! To keep up-to-date with our EAP releases set your update channel to Early Access Program: Settings | Appearance & Behavior | System Settings | Updates, Automatically check updates for “Early Access Program”

-PyCharm Team
The Drive to Develop

Posted in Early Access Preview | Tagged | Leave a comment

Welcome PyCharm Edu 3.5!

PyCharmEdu35_506x253Have you already started working on your new 2017 year resolutions? Maybe some of them have to do with learning or teaching more Python? If so, try PyCharm Edu 3.5, the next update for our Educational Edition. This release brings advanced course creation options for educators and more courses for students.

Subtask Management for Educators

When teaching your students to program, you often want to give them an opportunity to work with the same code fragment, gradually making tasks more complicated and sophisticated. With PyCharm Edu 3.5 it is now possible to add steps, or subtasks, for any task in your course. Read more about the feature on the blog or find more details in the getting started tutorial.

The IDE is distributed as free open-source software under the Apache 2.0 license. This means you and your students can download and use it for educational or any other purposes—for free!

For more details and learning materials, visit the PyCharm Edu website, or ask us any questions you might have here in the comments.


PyCharm Edu Team

Posted in Release Announcements | Tagged | Leave a comment

Inside Python Podcasting: Interview with Michael Kennedy

The Python community has long been hailed as inviting to newcomers. But it’s now huge, which can be daunting. Fortunately, we have some guides that help you sort through all the packages and happenings. Michael Kennedy has long been one of those guides, especially with his long-running, well-known Talk Python To Me podcast.

After almost two years and 94 episodes, the podcast has covered many of the most interesting and important aspects of the Python world: SQLAlchemy, PyLadies, teaching high schoolers, data science, business … and yes, PyCharm. The episodes have a fresh, conversational feel that manages to be both approachable to newcomers while useful to veterans. Moreso, you get to know and appreciate people in the community as much as the code they produce.

Recently, Michael has teamed up with Brian Okken of Test and Code Podcast fame to produce another podcast called Python Bytes which surveys the latest in Python, in brief episodes.

PyCharm caught up with Michael on all this Python podcasting activity in the interview that follows.

Hi Michael, thanks for doing the interview. Let’s start with a 2016 retrospective of all Python podcasting. Where are we and how did we get here?

You’re welcome, it’s great to be here.

If you compare the end of 2016 with the beginning of 2015, it’s night and day. Early 2015 was a pretty dark period for Python podcasts although it saw amazing growth of podcasts in general. 2015 started with exactly 0 active Python podcasts.

I was really keen to hear these stories and meet the people as you described in the introduction. Yet for Python podcasts, all we had available were a few excellent but older, on the verge of outdated, episodes from past podcasts. So I decided (in March 2015), that if I was to get the podcast I wanted, I’d have to take the chance and put myself out there and start one myself. That’s how Talk Python To Me came into existence.

In some crazy coincidence, Tobias Macey and Chris Patti, launched podcast.__init__ within a week (neither of us were aware of the other).

Shortly thereafter, I met up with Brian Okken (he works near me in Portland, OR) and talked about podcasting. He launched Test and Code (largely focused on Python, especially in the beginning) a few months after the first two shows.

Around the same time, Partially Derivative (the data science podcast), took a strong turn towards Python as part of their focus. Since then we’ve had The Python Experience and Import This: A Podcast for Humans launch. So it’s a great time to engage with the community and listen to the podcasts around Python and related technologies.

That’s a lot of activity. What factors do you think are driving it?

That’s a good question. I don’t know the answer entirely but I see two forces at work:

  1. Python is exploding in popularity and this is largely due to it expanding into areas it was less popular previously (think data science over the past few years). This means the audience is growing, the desire for these shows is growing, and there are many newcomers who seriously benefit from the look behind the code that podcasts can give you.
  2. I think the success that Talk Python To Me and Podcast.__init__ have had is an inspiration to others. Seeing Talk Python do so well, gain such an audience (we are about to pass 3,000,000 downloads), and frankly appear to be fun to be part of what has encouraged people who were considering starting a podcast to actually take action.

What are the reasons and factors that motivated you to start podcasting?

I’ve always wanted to do a podcast since I first started listening to them back in 2004.

However, it wasn’t until 2015 that things that I felt were essential actually lined up: a gap in the podcasting space where I was both enthusiastic and qualified to fill and the motivation to take the step to actually do all the work to build the show, the website, the format, etc, etc.

Explain the formats of Talk Python to Me and Python Bytes, and what drove the creation of the latter.

I consider Talk Python to be the audio equivalent of long-form writing. The conversations are highly researched by both me and the guests. The topics dig deep into an area (many times there is a single topic discussed for an hour). It’s highly produced. I spend about 5-10 hours on research and prep for each episode and probably 5 hours after the recording before it goes live.

Python Bytes is, as the name would indicate, shorter and made of many pieces. It’s 6 topics covered in 15 minutes total (so approx 2-3 minutes each). If you want to just keep abreast of the Python news, new projects, and releases for the week. It’s a great format for this. Also, I guess Python Bytes is very timely but makes less sense to go back and listen to an episode from a year ago whereas Talk Python To Me is much more evergreen content.

The motivation to create Python Bytes was my desire to create a show where we could talk about timely issues but that was contrary to my goals for Talk Python.

What’s it been like having Brian as a collaborator and how does that change the process?

It’s been a real pleasure to work with Brian. It’s a totally different format than I’m used to.

Usually, I can let the guests talk and I just ask questions. With Python Bytes and two co-hosts, it’s much more on the two of us to carry the conversation. That said, we are getting good at it I think and the format is starting to flow.

How do you choose your topics? And what do you see as your target audience for these topics?

I get topics from many sources. Originally, I chose topics I was familiar with and already knew: MongoDB, SQLAlchemy, and Pyramid.

After 95 topics, we are well outside of my area of expertise. Now I just look for things that are catching on with the community or seem interesting. I love the topics where it’s Python + (a thing), like the topic on Python at CERN / LHC and Python in Astronomy.

I get a lot of topic recommendations from my listeners and I really appreciate that too.

The target audience is really two groups. I try to keep the shows impactful and not watered down. I want people who have been developers for 10 or 20 years to get real value from listening. Yet, I try to avoid acronym soup or just diving deep right away into a topic because it’s important to me that these episodes are really accessible to newcomers even if they don’t know everything, they get enough to keep listening and learning.

For full disclosure, we had you for a PyCharm webinar. I enjoy those, but it’s certainly some work. Talk Python is far more frequent and likely far more effort. Is it still fun?

Yes, it is a ton of work (like I said, just Talk Python is 15 hours a week and Python Bytes is probably another 3-5 hours). But it’s absolutely fun and I’m really honored to be able to do it. Honestly, I can’t believe I get to spend a large part of my professional life doing this kind of work.

If you think of dream-come-true jobs, the ability to spend your time researching cool projects, talking to the founders and people you look up to in the community and sharing that conversation with many thousands of people every week, well, that is right up there.

I’ve always been interested in the business side of Python. Tell us a little about your training and Kickstarter, with a reasonably honest assessment of whether the podcasting is helping.

I am very interested in the business of open source in general and Python in particular. I have had the opportunity to talk to a few people doing very cool things to build successful and thriving businesses on open source and Python. You can hear their story on these episodes:

  • #34, Continuum: Scientific Python and The Business of Open Source with Travis Oliphant
  • #50 Web scraping at scale with Scrapy and ScrapingHub with Pablo Hoffman
  • #59 SageMath – Open source is ready to compete in the classroom with William Stein

I am happy to talk about Talk Python To Me and the business side.

Quick bit of history: I started the podcast in early 2015. I went independent with the podcast as my only source of income to focus on it and on growing it. That was Feb 2016. In April 2016, I launched my online Python training company on Kickstarter.

I see the podcast and the training courses as a continuum on a spectrum rather than two distinct things.

When people want to learn about Python, dig deeper into the back story on a web framework or ORM, they can listen into Talk Python To Me and get inspired. When they are ready to move from inspiration to action and learn that framework, the training courses pick up where the podcast stops with hours of hands-on training and lots of “live” demos they can code along with.

I was willing to quit my job and focus on this path because the podcast was generating enough revenue to basically pay the important bills (mortgage, utilities, food). I had dreamed of launching an online training business and the podcast gave me the safety net to do this without jeopardizing my family. I actually discussed this in depth with John Sonmez on episode 71 of Talk Python To Me.

The kickstarters were more successful than I expected and really proved the idea of my style of classes. I did two kickstarters. One in April for my Python Jumpstart by Building 10 Apps course. The other in August for my Python for Entrepreneurs course I did in partnership with Matt Makai from Full Stack Python. They both raise about 18x what I was asking ($33k and $39k respectively).

These courses are a lot of work. But I love making them and the response has been super positive. My goal is to make 20 courses of the next few years. Fingers crossed.

What are some programming podcasts that you have listened to?

I love podcasts. Here are the tech-focused ones I love.

Python-specific:

  • Partially Derivative
  • Test and Code
  • Podcast.__init__

The personalities of developers:

  • Away from the Keyboard
  • Developer on Fire

Amazing deep look at tech like solar energy space flight, etc.:

  • .NET Rocks’ Geek outs episodes (got to the tags section, chose these)

Security:

  • Risky Business

Business of software:

  • Exponent
  • Startup podcast

Looking at 2017 and podcasting, what’s one thing you think will or should stand out this time next year?

I think we’ll see the Python vs. Legacy Python divide essentially settled in Python’s favor (that is Python 3 vs. Python 2, reference). We’ll also see more use of the term Legacy Python.

In podcasting, I think we’ll see:

  • more Python podcasts created.
  • podcasts will continue to “grow up” where people put in more work than just hitting record and posting episodes (as we saw years ago). This is a continuum and we’ll move more towards polished shows.

Thanks again for joining us. As an exit, tell us about the podcasting booth at PyCon.

You’re welcome, thank you for the opportunity. Please come and hang out with the Python podcast community at our booth at PyCon in Portland this year. We’ll have Talk Python To Me, Python Bytes, Test and Code, Partially Derivative, and Podcast.__init__ all there.

I’ll be giving away some of my course content. We’ll be doing live recordings and open sessions. I hope to meet many of you there.

Posted in Interview | Tagged | 3 Comments

Make sense of your variables at a glance with semantic highlighting

Let’s say you have a really dense function or method, with lots of arguments passed in and lots of local variables. Syntax highlighting helps some, but can PyCharm do more?

In 2017.1, PyCharm ships with “semantic highlighting” available as a preference. What is it, what problem does it solve, and how do I use it? Let’s take a look.

It’s So Noisy

Sometimes you have really, really big functions. Not in your codebase, of course, because you are tidy. But hypothetically, you encounter this in a library:

2016-noselection

PyCharm helps, of course. Syntax highlighting sorts out the reserved words and different kinds of symbols: bold for keywords, gray for unneeded, yellow means suggestion, green for string literals. But that doesn’t help you focus on the parameter “namespaces”. Clicking on a specific symbol highlights it for the rest of the file:

2016-selection

That kind of works, but not only do you have to perform an action for each symbol you want to focus on, it also moves your cursor. It’s a solution to a different problem.

How can my tool help me scan this Python code without much effort or distraction?

IntelliJ Got It

As you likely know, PyCharm and our other IDEs are built atop the IntelliJ IDE platform. In November, IntelliJ landed an experimental cut of “semantic highlighting”:

“Semantic Highlighting, previously introduced in KDevelop and some other IDEs, is now available in IntelliJ IDEA. It extends the standard syntax highlighting with unique colors for each parameter and local variable.”

It wasn’t available in the IDEs, but you could manually enable it via a developer preference. Here’s a quick IntelliJ video describing the problem and how semantic highlighting helps.

With PyCharm 2017.1, the engine is now available to be turned on in preferences. Let’s see it in action.

Crank Up the Signal

Blah blah blah, what does it look like?

2017Our noisy function now has some help. PyCharm uses semantic highlighting to assign a different color to each parameter and local variable: the “namespaces” parameter is now a certain shade of green. You can then let color help you scan through the function to track the variable, with no distracting action to isolate one of them or switch focus to another.

To turn on semantic highlighting in your project, on a per-font-scheme basis, visit the Editor -> Colors & Fonts -> Language Defaults preference:

prefs

Your Colors Make Me Sad

The default color scheme might not work for you. Some folks have visual issues for red and green, for example. Some might have contrast issues in their theme or workspace. Others might simply hate #114D77 (we’ve all been there.)

If you make IDEs for long enough, you learn self-defense, and that means shipping a flexible means of customization:

colorpicker

The pickers let you assign base colors then gradients to tailor a wide number of local symbols to your needs and taste.

Learn More

PyCharm’s goal is to help you be a badass Python developer, and hopefully our use of semantic highlighting helps you make sense of dense code. We’re still working on the idea itself as well as the implementation, so feel free to follow along in our bug tracker across all our products, since this isn’t a PyCharm-specific feature.

And as usual, if you have any quick questions, drop us a note in the blog comments.

Posted in Cool Feature | Tagged | 14 Comments

PyCharm 2017.1 EAP 3 (build 171.2455.3)

We’re happy to announce the next EAP for PyCharm 2017.1, get it now from our website!

This week, we’ve fixed several issues, and added some functionality:

  • If you’d like PyCharm to watch your code style, we hope you’ll appreciate some new style options: closing braces can now be set either to line up with the last item or with the first character of a multi-line definition (Settings | Editor | Code Style | Python | Wrapping and Braces | Hang closing brackets, see PY-10182 for an example) . Also, if you like spaces around your parameters, you can now specify whether or not there should be spaces between the parentheses if a method has no parameters (Settings | Editor | Code Style | Python | Spaces | Within | Empty method call parentheses).
  • Various bugs regarding typing have been fixed
  • The VCS branches popup has been redesigned (Alt+`, option 7 ‘Branches’)
  • External tools after git commit
  • And more, see the release notes for details

Download it now from our website! To keep up-to-date with our EAP releases set your update channel to Early Access Program: Settings | Appearance & Behavior | System Settings | Updates, Automatically check updates for “Early Access Program”

-PyCharm Team
The Drive to Develop

Posted in Early Access Preview | Tagged | 2 Comments