Домой United States USA — IT Best IDE for Python in 2018

Best IDE for Python in 2018

362
0
ПОДЕЛИТЬСЯ

Not sure which IDE to plump for? We’ve highlighted five top-notch offerings here.
Best IDE for Python
1. Atom
2. IDLE
3. Thonny
4. Visual Studio Code
5. eric
Read on for our detailed analysis of each IDE
Our first baby steps with Python, which typically involve making a ‘Hello World’ program and a couple of typos, don’t require much in the way of specialist tools. It’s fine to hammer out the code in a text editor, switch to a terminal, and then run it. When it doesn’t work, you can return to the editor, fix the typos, then run it again.
However, as coding and testing becomes more complicated, involving multiple files and unit tests, these context switches become inefficient and frustrating. Life is easier when we can write, run and wrangle our code from the same place.
Exactly where a fancy text editor stops and an Integrated Development Environment (IDE) begins is a fuzzy boundary. At a minimum, you’d want an application that: does syntax highlighting, code-folding and bracket-matching, has some awareness of the constituent source files of a project, and facilitates running the code (or part thereof). More advanced features might include code suggestions, a debugger, and integration with online repositories.
In this article we’ve picked five of our favorite IDEs, which are efforts that we feel give a good overview of what’s on offer. We’ve also chosen the best laptop for programming
1. Atom
An IDE that facilitates pretty much anything you can think of
Clean and smart interface
Comprehensive package manager
Sizeable memory footprint
Atom describes itself as a «hackable text editor for the 21st Century». It’s maintained by social coding megalith GitHub, so as you’d expect it can do pretty much anything you can imagine. And if it can’t, then someone’s almost certainly working on a plugin to address that.
Atom has its own comprehensive package manager, and a huge community working on packages for it. As well as built-in Git and GitHub integration, Atom allows you to collaborate on coding projects in real-time via the Teletype package. Several thousand other packages are available, but Python coders looking for a more efficient workflow would do well to seek out a script package.
This offering is based on the electron framework, so Atom is cross-platform, but also has a not inconsiderable memory footprint. Coders who prefer their apps to be lightweight will balk at the 400MB (including its dependencies) install footprint and should look elsewhere. But even on a modest system it runs fine and all the functionality Atom provides means that it’s well worth the space investment.
Despite all its features, Atom has a clean interface and is much more beginner-friendly than you’d expect. The project view is helpful once you start to dabble with bigger projects and you are free to split the panels of the interface to suit your fancy. You can download Atom here
2. IDLE
Python’s very own minimal IDE that won’t get in your way
Nicely lightweight
Powerful debugger
No project management capability
It’s easy to overlook IDLE – Python’s very own bespoke Integrated DeveLopment Environment. IDLE (named after Monty Python’s Eric Idle) is fairly minimal compared to some of the other offerings around, but it has everything you need and certainly won’t get in your way.
It’s coded in Python and uses the lightweight tkinter toolkit to draw its GUI. Starting IDLE will open a Python shell, just as you get when starting Python from the terminal. You can play around with code snippets here, with the bonus that keywords and output will be nicely colored.
Moving on from here you can open a new window to start coding proper. Your code will be appropriately highlighted and automatically indented, with a configurable indent level. IDLE supports using spaces or tabs for indentation, and can automagically convert between the two – plus it can indent multiple lines at a time.
IDLE lacks any project management facilities, but that’s no problem if your project spans only a handful of files. It has a powerful debugger which allows single-stepping through the code or over-stepping through each high level function. The debugger shows the call stack as well as the state of local and global variables. You can download IDLE here
3. Thonny
Comes as standard in new versions of Raspbian
Excellent debugger
Ideal for novices
But sadly installation isn’t user-friendly
Thonny is the least ‘developer-centric’ of all the IDEs we’ve highlighted here, but that doesn’t mean it’s any less powerful. It’s developed at the University of Tartu in Estonia, and is itself written in Python. It features a powerful debugger that’s great for learning the ins and outs of coding without worrying about how breakpoints work.
The debugger can show you the state of variables as the program runs. It lets you take small or large steps through the program, which is great if you’re tracking down hard to find bugs. This is much better practice than – as beginners and seasoned coders alike are occasionally tempted to do – peppering your code with messy print() statements.
Thonny will automatically indent as you type, which is helpful for anyone new to Python since the language uses indentation to delineate functions, loops, classes, clauses, etc. It will autocomplete your code and provide bracket/parentheses matching. It will also helpfully highlight any syntax errors.
It would be ideal for beginners, but for the fact it’s a little tricky to install if you’re unfamiliar with Python packages and in particular pip (a package manager for Python). That said, it is included as standard in new versions of Raspbian and is well-suited to Raspberry Pi projects. It’s just a shame that other distros don’t include Thonny in their repos. You can download Thonny here
4. Visual Studio Code
Microsoft’s code editor is now a popular choice among devs
Powerful features
Impressive extensions marketplace
Minimalist ‘zen mode’
Once the nemesis of FOSS software, Microsoft has, under the stewardship of Satya Nadella, taken a much friendlier stance towards all things open source. The company may not be about to release the source code to Visual Studio, but in 2015 it did release a source code editor, Visual Studio Code – or Code for short – and open sourced the core of it. Code has since become rather popular amongst developers, and it’s a fine choice for your Python projects too, once you’ve installed the Python extension, that is.
Code has its own debugger, supports linting, and has integration with all manner of source control tools. It has a built-in terminal too, and a well-stocked extensions marketplace (don’t worry, they’re free). It can also run and debug your project’s unit tests through the unittest, pytest or nose frameworks.
If all this sounds a little too much, it also has a minimalist ‘zen mode’ which shows you only the file you’re working on, hiding not just Code’s interface, but the rest of your desktop too.

Continue reading...