Hacker News new | past | comments | ask | show | jobs | submit login
Thonny: A hassle-free Python micro-IDE (thonny.org)
312 points by nine_k 9 days ago | hide | past | favorite | 102 comments





I recommend this to my students frequently. I teach an intro to programming class to college students who have no experience. Inevitably, some try to use PyCharm and they just get lost in it! I tell them it's like learning to drive in an 18 wheeler with a manual transmission. Thonny is very much the Toyota Corolla of IDEs and it's perfect for beginners.

The debugger and variable pane really help beginners figure out what's going as their program runs.


I recommend Geany[1] to students learning Java for the same reason. Many students used to try to use Eclipse, but would get bogged down in Eclipse' notion of a "project" and other details that were unrelated to the simple tasks they were trying to do. Geany is much easier for them to get started with, and still provides a graphical way to run and debug code.

[1] https://www.geany.org/


Back when I was in school, we used BlueJ [1]. I still think it's an extremely approachable IDE that has all the basics but not much more.

1: https://www.bluej.org/


I remember using Dr Java in my computer science course 12 years ago, not sure how relevant it is anymore.

I recommend people starting with programming to try https://codewith.mu/ . It's a Python IDE that's very simple, it doesn't even use menus, just few big buttons so that it's not distracting the users with multiple options.

There's a point of difference though which is quite important especially for teaching: Thonny also works with MicroPython, i.e. it can do things like giving you a REPL which directly talks to the MicroPython interpreter running on a controller like ESP32 (so you say led.On() and the actual hardware LED goes on), upload code to it, has shims for common MicroPython modules which are implented in C (iirc), etc.

Sometimes I end up teaching friends a bit about programming. I should really stop starting them on vim...

> Inevitably, some try to use PyCharm and they just get lost in it! I tell them it's like learning to drive in an 18 wheeler with a manual transmission.

Not really. You don't have to use all its features, they are neither necessary nor intrusive. E.g. I hardly know, let alone use more than 10% of its functionality. The only reasons I use it are very smart code completion, refactoring (rename variable/class/function/whatever, jump to definition, find all usages), breakpoint debugger, auto imports suggestions, and type hints derivation. I barely even use menu items besides "reformat code". But the smart code completion IntelliJ IDEs offer is by far the best on the market so its worth that. Extremely useful for lazy/occasional/novice coders who don't remember APIs by heart and don't want to sopend much time browsing the docs every time.


I'd assume you are not working in education? Of course, PyCharm has great features and you don't need to use all of them when working with the IDE on your own as a novice coder. But as a teacher, you have a completely different problem: You need a really simple, easy to explain environment - no fuss, no unnecessary complexity. Students /will/ explore unused features on their own and get lost or mess up. There is simply no time to deal with all possible problems individually as a teacher.

> I'd assume you are not working in education?

Not right now, but I did.

> But as a teacher, you have a completely different problem: You need a really simple, easy to explain environment - no fuss, no unnecessary complexity.

Just tell them to ignore that complexity and only press this and this.

When I was a kid we were taught to code (simple games in C/WinAPI and C++/MFC) in Visual Studio 6 Enterprise Edition on Windows NT. Visual Studio (especially its enterprise editions) traditionally has tons of features which still seem extraterrestrial to me but you are safe to ignore them.

Just don't click those weird menu/toolbar items. Just create a project, write the code (with help of super-smart auto-completion) and press Run, use some conveniences (like refactoring and debugging) once you are told or read about those particular. Easy-peasy.


>Just tell them to ignore that complexity and only press this and this.

You have used 3 "just do this" kind of statements in this comment. I would not like to be in your class. Students should be encouraged to explore, and its a teacher's responsibility to create an environment where its fun and valuable and not frustrating. This is why newtonian mechanics is taught before quantum and quantum mechanics before quantum field theory. Once a person is familiar with one abstraction you drill down. I know all this is hard, but if it was easy everyone will just teach themselves. The whole point of having a teacher is someone who can setup a protective bubble around you when learning.


Just because you learned using a more complex tool doesn't mean it wouldn't be easier for most students to learn using a less complex tool. It just means learning with a complex tool is possible. I don't think anyone would argue against that. They're just arguing it might be easier the other way around.

“Here’s something that isn’t meant for your use case, but just ignore most stuff”

Vs.

“This does exactly what you want”

Of course, there are advantages to learning with the same tool you could also go on to use professionally.


I'm surprised that you find Vim unintuitive elsewhere and talk about "just" creating a project in VS.

VS projects in the IDE are one of the most convoluted development ways I've ever seen.

Students won't learn anything except developing Stockholm Syndrom for a bloated proprietary environment.

If it must be Windows, I'd rather teach cl.exe and Makefiles or adapted .vsproj files with msbuild.


> I'm surprised that you find Vim unintuitive elsewhere and talk about "just" creating a project in VS.

Just go to the "File" menu, Click "New project" there, choose the type (a console app or a GUI app), enter the name and press Ok. The teacher shown us when I was a kid and nobody found this difficult. Of course, we never cared (until grown up and started to care about versioning) about the auxiliary files the IDE created to accompany the code in the project - understanding those never happened to be a necessity.


> Not really

No, really! Sorry, but I've run hundreds of students through this course and that's my actual experience. I love PyCharm. It's a great tool. It's not what beginner programmers need to learn the fundamentals of programming.


Imagine telling the students to use vim if they have never used it before. In theory, one only needs to know a few things to edit:

- type vi <filename> to start editing

- there are two modes: 'i' to start insert mode, <esc> to leave it for normal mode

- in insert mode, what you type is entered as you type

- in normal mode, use the cursor keys to move around

- in normal mode, type 'x' to delete the character under the cursor

- type :wq to save and quit

What are the odds a vim-virgin could complete a programming assignment without getting tripped up, despite the explicit directions to use just the features above?


> Imagine telling the students to use vim

I can hardly imagine that. They would hate me for wasting their time they could use to learn something practical. To me Vim seems a crazy alien technology of particularly questionable usefulness (even for a keyboard-centric user), only suitable for fun and for looking cool. Unlike PyCharm or Visual Studio, Vim doesn't just have unintuitive features available to whoever chooses to invoke those, it is and can only be operated in a completely unintuitive way, impossible to learn without instruction. And I never needed any instruction on how to use, let alone exit PyCharm.


> I can hardly imagine that. They would hate me for wasting their time they could use to learn something practical. To me Vim seems a crazy alien technology of particularly questionable usefulness (even for a keyboard-centric user)

I know tons of developers and system administrators that use vim on a daily basis (that includes me). While I agree that I would not necessarily recommend it for a beginning student, it is entirely unfair to describe it as having "particularly questionable usefulness", and "only suitable for fun and for looking cool". I and many others use vim for real work, not for "looking cool".

Yes, the learning curve is high, and it requires investing some time to learn. My experience is that the time I spent learning it was well worth the investment. It's not for everyone, but that doesn't mean that it not for anyone.


> it is entirely unfair to describe it as

That's why I wrote "To me Vim seems...". Beyond the fact it's impossible to start using it right away without instruction, everything else is subjective and context-dependent.

> My experience is that the time I spent learning it was well worth the investment.

How? I tried. But I still can't see how its key shortctus are better than the common ones (i.e. how Esc,Shift+G (yes, I just googled it) is better than Ctrl+End) and how its power in applying bulk edits to many places at once can make me more productive (it would mean I write redundant code if it could). What other things does Vim have which other editors/ides don't? I also find coding without JetBrains-level smart code completion a waste of time.


> I also find coding without JetBrains-level smart code completion a waste of time.

Meanwhile as a Vim user I am glad it doesn't try to be smart and "help" me by obstructing my view on the code with automatic popups listing suggestions I never asked for, formatting "corrections" while I type that make my sequence of inputs incorrect, and tab management that feels like a struggle without using the mouse. Meanwhile I once spent minutes trying to find a syntax error in intelliJ because while it did indicate with a red box that it found an error there was no indicator for its location...but I sure was glad it marked all warnings and apparently incorrect spelling in comments right beside the taskbar.

Vim respects my time and attention and has virtually no limitation when it comes to defining keyboard shortcuts. No, it doesn't have a bulk replace that's actually semantically aware, but it took me not more than a day to write a "close enough" replacement in Vimscript.

Or, to quote Jonathan Blow's excitement while using VS: "Is there a setting to fire the people who designed this UI?"


> That's why I wrote "To me Vim seems...".

That's fair. I was left with the impression that you did not think it could be useful to anyone.

>Beyond the fact it's impossible to start using it right away without instruction, everything else is subjective and context-dependent.

It is a very different interface. It does not work like other editors. Some people don't like mode-based editing, and thus they will definitely not like it.

> How? I tried.

This is a common experience for people attempting to learn Vim. Like I said, the learning curve is high. It takes a long time to become proficient. As to how it is worth the investment to me, I think most of the gains come from the fact that it is a keyboard-oriented editor. I can find the piece(s) of a file that I want to edit, and make changes quickly. As 'blackcats' pointed out elsewhere in this thread, vim lets you move around the file quickly.

> I also find coding without JetBrains-level smart code completion a waste of time.

I use the IdeaVim extension for vim-like keybindings in JetBrains IDEs. It's not perfect, but it implements a fair bit of the keybindings in vim. I understand the desire for code completion, it can be very handy.


> As to how it is worth the investment to me, I think most of the gains come from the fact that it is a keyboard-oriented editor

I don't use much mouse when I code in Sublime or PyCharm.

> As 'blackcats' pointed out elsewhere in this thread, vim lets you move around the file quickly.

All the commands he/she mentioned have classic counterparts with Home/End/etc keys, available pretty much everywhere. I use them a lot even now, writing this comment.


> All the commands he/she mentioned have classic counterparts with Home/End/etc keys, available pretty much everywhere. I use them a lot even now, writing this comment.

Many of those keys require you to move your hands far from the home row (in ways that make it slower for me to type them). I find that the vim equivalents are easier to touch type. Plus many of the gains are not just in the motion, but in editing commands (as well as combinations of the two).

To each his own.


Vim lets you jump through text. Try G for bottom, gg for top, $ for end of line, 5j to jump 5 lines, 0 for start of line, w to jump word, b backwards etc. Once you know the shortcuts it’s very comfy and you can use them in any modern IDE like JetBrains and the terminal. Having one workflow everywhere (term, ssh, IDE) does it for me

> Vim lets you jump through text. Try G for bottom, gg for top, $ for end of line

How is this better than Ctrl+End for bottom, Ctrl+Home for the top, End for end of line? I believe these keys have actually been put on the keyboards right for this and that's why their names are self-descriptive.

> 5j to jump 5 lines

I can't imagine a case when this would be of serious value.

> w to jump word, b backwards etc.

Ctrl+arrows.

So, I still don't get it although I sincerely want to.


The real advantages of Vim start to become clear once you know the basics and start to understand in how many ways you can combine them efficiently.

You can press 'dw' to delete the word right of the cursor. 'd/]' to delete everything from the cursor to the next closing bracket("delete and search next ]"). 'dip' to delete the whole paragraph around the cursor("delete in paragraph"). 'di{' to delete everything between the closest pair of curly brackets.

And this doesn't just apply to deletion but most other operations. Vim lets you just combine delete/copy/replace/... commands with inputs that move your cursor, whether it's just the current line or a whole 100-line table column. And of course you can tell it to repeat those operations by entering a number beforehand, or just repeat the last operation by pressing '.'.

Vim doesn't make you a 10x developer but it will make you think "oh man, was it really that cumbersome?" whenever you go back to a normal editor. Do you like always moving your hand to the mouse and back when you want to select text? Probably not. Vim makes that step completely unnecessary, among other things.

Don't get me wrong, it's not for everyone and that's fine. But if it fits your way of doing things it's a super efficient and flexible tool that is only limited by the user. I've been using it for over 5 years and still learn new, clever ways of doing things quicker.


> You can press 'dw' to delete the word right of the cursor.

And I can press Ctrl+Del to achieve the same. Right here in this commend edit form.

> delete everything from the cursor to the next closing bracket

This seems slightly interesting but not really. Many good text editors would highlight the matching bracket and it usually is just a tiny bit more slow to delete everything to that point.

> 'dip' to delete the whole paragraph around the cursor("delete in paragraph")

Hardly ever needed this in my entire life.

> And of course you can tell it to repeat those operations by entering a number beforehand, or just repeat the last operation by pressing '.'.

I know but can't imagine a use case for this.

I actually want to master Vim, let me be sincere, just to look more cool and professional, impress the boss and feel more of a hacker but that's not enough of motivation for me and I'm desperate to find anything in it which would actually feel handy.


Vim pays me the bills.

One thing I haven't seen mentioned here yet: Thonny explicitly supports Micropython for embedded systems development: https://github.com/thonny/thonny/wiki/MicroPython

IME Thonny is a great sketchpad for Micropython ideas, and makes work on that platform nearly as easy as locally-run Python code.


Yup, and Raspberry Pis. ... good stuff. It would be double-cool if they could do something about the need for lots of RPi hardware-hacker programs to run as root. It's open source, though ... pull request time?

Solid push into Arduino IDE territory as well.

Just by the screenshot, does this remind anyone else of R Studio?

I'm a psychology major and working as a "student tutor", which in my case means helping lower year students work with R for statistical analysis. A lot of them are struggling, but for the ones that aren't and show further interest beyond R, I might recommend this IDE after looking into it more!


FWIW, it's rare these days that I need to go "beyond R" for anything. If there were a Python IDE that worked as well as RStudio, I might explore it.

Didn't use RStudio for a while, but I find Spyter to be more similar.

It reminds me of the MATLAB IDE, early versions. The matlab IDE is still pretty simple, but it used to simpler.

Thonny is very cool and also a proof a Tkinter GUI doesn't have to be ugly and can actually be beautiful. I hope it's going to be developed actively and becomes smarter and smarter (but not bloated).

That's Tkinter? I didn't even realise it. It looks perfectly ... normal.

I've used this in the past with my son to teach him simple stuff. Would be nice if it somehow had integrated docs though, at which point it would be roughly up to speed with QuickBasic in the 80s.

I see that Thonny has the Python shell built into it.

You can use the help function to see some information about things.

For example:

    help(list)
Of course all of the help that you get that way is only useful if you already know the concepts you need and the names of things. It’s not like a tutorial or a guide or anything. But still, if you find yourself forgetting some detail about something it can be a way of finding the information you need.

UI definitely reminds qbasic and other similar IDEs of an era (turbo pascal, turbo cpp, etc.). And docs on lang + stdlib would be very good!

I would love to see someone change the tiny debugger icons for actions like "pause" and "next step" to giant, obvious, text only buttons with a clear and colorful call to action. They're the most important buttons on the IDE for beginners and they're the least obvious. Also, make breakpoints discoverable if you don't know that they're possible.


pull request time? a teacher might have a lot of influence on that team.

I'm probably nostalgic, but the GUI looks so refreshing. I think I need more Tk in my interacting-with-guis part of life.

I think it may be the whitespace in the UI. It really gives the thing room to breath

No! Fwiw, there's a bit too much of it, but it's not even close to the offendingly huge margins of some modern UIs (not arguing there's no place for this UI style at all).

The main window on the first shot from the site is about 620px wide and I feel I could write some code not even resizing it. I easily imagine 2 buttons, dropdown and 2 textboxes filling this whole window instead.


It's so irritating that good clear visualization and minimal boilerplate is considered "for beginners". These features should be available in every programming environment.

It is friendly to beginners, but of course not limited to beginners.

Thonny just seems to do few things, but do them rather well.


I love Thonny. I got my first taste with the original RPi and it is hands-down the best Python IDE out there. My 10 year old son uses it frequently.

It is so simple, approachable, and un-intimidating. There is really no learning curve. Just type something and click run.


Thonny is included by default in the Raspberry Pi OS

I like it. Less distracting than an IDE for beginners.

The GUI is based on tkinter. It looks surprisingly good.


Love for Thonny here. It's a great IDE, supports MicroPython, has an intuitive interface with a very kid friendly mode. The perfect beginners IDE in my opinion.

Of note, it is the default installed Python IDE on Raspberry Pi OS.


A neat teaching environment with visual AST walkthroughs. Having inspection/reflection facilities built into the standard library of a programming language is a boon we rarely appreciate.

Why is everything an IDE? I don't want an integrated development environment - I want a modular one. And as one of those modules, I would love a simple, lightweight code editor. UTF-8 only, auto-indent, a file list column, a good find-in-page feature, and file type dependent syntax highlighting and multi-line comment key. That's all I need. It seems I am always stuck between bloated IDEs (or bloated text editors like VSCode and Atom) or painfully low-featured ones like notepad or nano.

There are plenty of mid-level editors out there. Sounds like Notepad++ and Sublime Text are up you alley.

Also, it depends what you mean by bloated, but VS Code can be stripped down to work just like the two I listed above. Language servers aren't required by any means. If you're looking for sub 50MB ram usage, then stick to the two above and search for "Sublime Text alternative" and I'm sure you'll find more equivalents than you ever wanted.


I've used Notepad++ and Sublime Text and like them a lot, but I could really use something that can run on a Raspberry Pi too. I guess I should have included that. Being able to use a single text editor across platforms would be terrific.

I prefer Atom.io over VSCode for simplicity. It's much closer to working the way I want out-of-the-box. There's so much junk I have to disable in VSCode to get it where I like.


Geany is cross-platform and runs on RPi

There's been talk about work on a build of sublime for arm64 -- I think if you poke around on their forums there was a link or contact to get a beta copy for licensed users.


I would recommend micro editor then (https://micro-editor.github.io/). It's like a souped-up and much nicer to use nano. It supports syntax-highlighting out of the box, auto-indents, etc. I think you might like it :)

You seem to be spec'ing either vim or emacs, there.

Sorry, I guess I didn't know I had to include "and without a completely unnecessary non-standard interface that requires a massive learning curve to get started." as a feature.

Well, if you want all the things, you're going to end up at "write your own", it seems. If you can't find yourself a text editor, of all the things programmers love to write to scratch their own itches and which we have coming out of our metaphorical collective ears....

That sounds a lot like Geany

https://www.geany.org/

I see it more as an good modular editor that they dressed up as an IDE cause that is what the people say they want.


I would also prefer a good editor (rather than an IDE), if only it had really intelligent context-aware autocompletion and would let me rename variables/classes/etc reliably (without using dumb search-and-replace).

Wait, how would the editor be able to auto-indent Python code!? Since python is white space sensitive and don't have "end" or } to mark the end of a block.

Like every editor. Colon, new line, indent. Statements, backspace dedent.

gEdit? Kate? jEdit? One of those might fit your needs.

While there are a lot of options, I'd guess you'd really like JED.

I'm serious, give it a spin, it's underrated.


and old book about unix describes it as such.

each individual program is its own module, fs to link them (files or pipe)


You have basically described the Zeus Lite editor. However it only runs on Windows :(

Geany and micro complement each other nicely as the CUA keybindings match.

Do you feel most beginners would agree with you?

Seems like you want vim or emacs?

Why is more tools a problem?


You have heard of vim and emacs haven't you?

I like the thonny IDE for small programs. I've been making all kinds of small scripts https://python-commandments.org/python-zip-function/

I start complete beginners to programming with Thonny.

Thonny has everything included to start quickly no external plugins, installs needed.

The debugger and the shell work quite nicely.

Key bindings are a bit different (instead of Ctrl+/ you have to use Ctrl+3)

After a few weeks I migrate them to VS Code or PyCharm and later Jupyter .

Every semester a few students stay with Thonny and it does not hold them back from making great projects.

You can install packages with Thonny but it tends to conflict with Anaconda installation leading to https://xkcd.com/1987/ situation.


The debugger looks neat. Would be nice to have the same micro-IDE for Go, Rust, Ruby, etc. Something like the Jetbrains tools, but open source.

Fun fact: the core of Jetbrains IntelliJ is a very capable real, extensible open source IDE that they've released themselves.

I suspect (but I'm not sure) that the rest of their desktop products are built on top of that.


Yes, the community edition set of editors are the only ones I use.

But there are no open source plugins for Go or Rust in top of intellij. So for all intents and purposes the editor is not open source for those languages. As far as I know no one in the community has tried implementing an open source plugin to compete with the proprietary ones.


They also have generous early access programs.

(And for anyone who wonders, no, I'm not paid and I don't use it - because of ergonomics - for me it is almost as painful to use as Macs are for me. I see inconsistencies and weird defaults everywhere since I'm a NetBeans / VSCode / Sublime Text kind of person. I just love Jetbrains business model.)


This seems pretty true, basically each IDE seems to be the same core with different plugins enabled. At one point you could turn IntelliJ into basically PyCharm with a few plugins supplied by jetbrains themselves.

Sounds a lot like eclipse of yore...

Also true.

Looks similar to Spyder: https://www.spyder-ide.org/

I've done lots of volunteering teaching programming to kids and recommend this for Python - it is pretty much foolproof to install which is a major thing of you only have an hour and a half session and you can get pygame working on it extremely easily - which a lot of projects for kids use.

Seems very nice, I'll have my kids try it next.

They're currently using Mu (https://codewith.mu/) which has similar goals (very streamlined IDE aimed at kids and beginners).


Cool, simple app. I can see this being really useful for teaching programming to beginners, although I'm curious where the name "Thonny" comes from? Couldn't find anything on the website, does anyone know?

"thon" is from "Python" and "Thonny" is diminutive of this.

Don't know how I didn't see that before! Thanks.

Built on Eclipse, or just leveraging the LAF?

No, it’s actually Tk.

It's the best-looking Tk app I've seen. I occasionally launch it just for aesthetic pleasure.

Seems brilliantly simple yet featured.

Another recommendation: bpython.

bpython is the friendly alternative to ipython.


ptpython is awesome too, sort of in the middle.

Who is this made for ? I'm not hating but genuinely curious.

Kids. It's a beginner's IDE for Python, without all the GUI frustrations of IDLE.

Has anyone ever attempted a web/browser based port?

No disrespect intended, but why is this needed? VScode is free, cross-platform, extremely easy to use, and you can run jupyter notebooks in it. I can't imagine telling someone to start python and not starting them in a notebook.

Well, imagine harder. ;-)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: