ASK HACKADAY: how DO YOU PYTHON?

Python is the Arduino of software projects. It has a critical mass of libraries for anything from facial recognition and neural networks to robotics and remote sensing. and just like Arduino, I have yet to find the killer IDE for Python. possibly I just haven’t tried the best one yet, but it could be that I’m just doing Python wrong.

For Years I’ve Been IDLE

IDLE with interactive shell that has highlighting and code completion
I’m a Linux-only type of a man so using IDLE for Python is a natural fit. It’s in the repositories for very quick and easy install and there’s essentially zero configuration to be done. typically speaking my preferred development environment is text editor and command line compiler. IDLE is just one step above that. You get a separate window for the shell and each Python file you’re working on. have IDLE run your code and it saves the file, then launches it in the shell window.

For me, there are two essential features of IDLE’s shell. The first is that it keeps an interactive session open after you run your Python code. This implies that any globals that your script uses are still available, and that you can try out your code by calling functions (and classes, etc) in real time. The second desirable feature is that while using this interactive shell, IDLE supports code completion and docstring support (it gives you hints for what parameters a function accepts/requires).

But simplicity has a difficult time scaling. I’m working on larger and larger projects spread over numerous files and the individual nature of IDLE editor windows and lack of robust navigation has me wanting to relocation forward.

The Contenders

I’ve tried possibly a half-dozen different Python IDEs now, spending the most time on two of them: Geany and Atom. Both are easy to install on Linux and offer the much more advanced features I want for larger projects: better navigation, cross-file code completion (and warnings), variable type and scope indication.

The look of Geany brings to mind an “IDE 1.0” layout style and theme. It’s the familiar three-pane layout that places symbols to the left, code to the right, and status along the bottom. When you run your program it launches in an interactive terminal, which I like, but you lose all IDE features at this point, which I despise. There is no code completion, and no syntax highlighting.

I have been using Atom much much more than Geany and have grown to like it enough to stick with it for now. I’d call Atom the “IDE 2.0” layout. It launches with a dark theme and everything is a tab.

Atom has symbol view that isn’t shown all the time. CTRL-R brings it up and it uses a search style but you can also scroll through all symbols
Atom depends heavily on packages (plugins that anybody may write). The package management is good, and the packages I’ve tried have been superb. I’m using autocomplete-python and tabs-to-spaces, but again I come up short when it concerns running Python files. I’ve tried platformio-ide-terminal, script, and runner plugins.  The first brings up a terminal as a bottom pane but doesn’t automatically run the file in that terminal. script also uses a bottom pane but I can’t get it to run interactively. I’m currently using runner which has an alright display but is not interactive. I’ve resorted to using a “fake” python file in my projects as a workaround for commands and tests I would typically run in the interactive shell.

Tell us how You Python

It’s entirely possible I’ve just been using Python wrong all these years and that tinkering with your code in an interactive shell is a poor choose of development processes.

What do you choose for your Python development? Does an interactive shell matter to you? Did you start with IDLE and relocation to a much more mature IDE. Which IDE did you end up with and what kind of compromises did you make during that change. Cho chúng tôi biết trong các ý kiến ​​dưới đây.

Back to top