Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Thonny's User Interface

Give Feedback

Now that you have Thonny installed, let’s make sure you understand what this IDE has to offer. Think of Thonny as the workroom in which you will create amazing Python projects.

Your workroom contains a toolbox containing many tools that will enable you to be a rock star Pythonista. You’ll learn about each of the features of the UI that’ll help you use each of the tools in your Thonny toolbox.

00:00 The User Interface.

00:06 Thonny’s user interface is designed to help you write code quickly and efficiently and run it. Let’s look first at creating, saving, and opening files. Here we are in Thonny, and we’re going to take a look at the icons—some of which are going to be familiar, some of them won’t.

00:23 So, the first few are standard icons, which you’ve probably seen if you’ve used a word processor, et cetera. Starting on the left, we’ve got New, which is Command or Control + N, depending on the platform that you’re on, and that will create a new file.

00:37 So clicking it, we can see we’ve got a new file here. We’ve got two files opened. And just to demonstrate that they’re different, I can type 1 in one, 2 in the other, and flip between them, and you can see they are different.

00:51 The star (*) means the file has not been saved yet, and a new file will have the name <untitled>. If we try to close it, it will ask if we want to save it before closing, so it will help you not get rid of work that hasn’t been saved.

01:05 The next button is Open, that familiar folder icon, and when you click that you get the standard file selector, depending on which platform you’re on.

01:14 So, this is on Mac, where you can see three files available. We’ll show you on Windows. Here’s the same in Windows. So, we click Open and move to Documents and where my Python files for this course are stored.

01:31 And here it is in Ubuntu. So again, opening that up, navigating to the right folder, and then opening a pre-created file will allow that to be opened using the OK button—in this case at the top right.

01:47 Whichever platform you’re on, you’re probably used to it and you’ll know what it is. And here, I’m just going to load up first.py back on the Mac.

01:55 And, as you’ll see, is your traditional “Hello, World!” program, which we’re going to run in a second. The final of the three familiar icons is the Save one.

02:08 If you click that, it will either save the file that you’ve already named, or if you have an unnamed file such as this <untitled> here, and we put some content in it, so print('Hello Again!'), a variation on “Hello, World!”. If we click Save here, it will prompt us for the filename. Again, the exact look of this will depend on the platform you’re on.

02:33 Here we are on a Mac, where I can enter a filename for it, calling it second in this case. Now, there’s a nice feature with Thonny is if you don’t put a file extension on there—so normally, you would have .py on the end—if you don’t put that on, Thonny will put it on for you.

02:51 If we click Save, you can see it gets called second.py. Again, let’s see that in action. Here we’re on Windows. We have an untitled window, we click Save, navigate to the appropriate folder, and then give it a name. Again, second, hit Save, and it’s called it second.py.

03:14 And again, here on Ubuntu, same thing. We’re going to navigate to the right folder, call it second, and then save that.

03:28 Here we are back on the Mac. If I make changes to this file, you can see the * appears to indicate that this file has not been saved.

03:39 This can be really useful if you have multiple files open and you’re not sure which ones you’ve saved, which ones you haven’t, et cetera. So that’s going to make life much easier for you.

03:51 Another thing that’s important about Thonny is you can’t run a file until you’ve saved it, so you need to save it before you run it because it actually runs the file off of the disk rather than from the editor’s memory.

04:08 Keyboard shortcuts are really important, so I would try and learn them. Things such as open, new, save, and run—getting used to those is going to mean you need a lot less mouse mileage and you’re not constantly changing modes from keyboard to mouse and moving around. In a lot of the work you’ll do in Thonny, you won’t need to use the mouse at all.

Harsha Vardhan on Dec. 18, 2019

It’s a good editor for solving leetcode and hackerrank problems in local system before submitting. Thanks for sharing..

Become a Member to join the conversation.