The New Way to Code Python

By Lennart Kats20 January 2016

Python has come a long way since its inception 25 years ago. Since then it has been used for the special effects of Star Wars movies, and last year it overtook French as the most popular language to be taught in primary schools. And today, we’re launching the new Cloud9 Python workspace type, together with better Python support for all existing users and workspaces.

Our new Python workspace combines everything you already know and love from Cloud9 — coding in the cloud, collaboratively, online, anywhere, anytime — with new features for Python coding bliss.

Better code completion

The first thing you’ll see in our new Python workspace is our improved code completion support. We now support code completion of Python across your whole project and libraries used, with inline docs and what not.

If you’re interested to see how we built code completion for Python, you can find the code completer plugin (licensed MIT) at https://github.com/c9/c9.ide.language.python. We used the Jedi library (not to be confused with that other Jedi library). Also keep watch of this blog as we’ll revisit that implementation later.

Source code linting

Cloud9 lints all your code using Pylint, catching common errors, mistakes, and potentially even stylistic issues. It can be strict at times, but you can customize it with a pylintrc file and command-line options that you can set in Cloud9 preferences.

Python 2, Python 3: choose your side!

There has been an ongoing debate, or at least some interesting soap story, around the update of Python 2 to Python 3. Python 3 was released in 2008, and it brought us many great things like strong Unicode support, but it broke compatibility with Python 2. It will take decades before more Python 3 code has been written than Python 2 code.

As we’re adding proper code completion and improved linting we’re also adding new UI to choose the Python version you want to use. And it’s really not a dark side / light side kind of deal, both are good. Just pick one! We also allow you to set your PYTHONPATH, which is especially useful if you like working with virtualenvs.

Jump to definition, Django, Flask, and other frameworks

Cloud9 comes with a built-in Django template. With our latest improvements, you can use the “jump to definition” feature to jump straight into the Django source code (or your own), and get code completion for all of Django.

As if that wasn't enough, we are now supporting Flask, a cool new micro framework for light-weight web apps. We pre-installed the pylint-flask plugin for pylint to make it work just right. Udemy has a course on Flask that uses Cloud9, and they provided us with feedback to get the integration working well.

Come try it!

Go to https://c9.io/new now to try out the new Python workspace type. It comes with a nice new template and everything you need preinstalled. And let us know what you think at our community pages!

Lennart Kats

Read more posts by Lennart Kats.