IDLE3:12 with Kenneth Love
Python comes with a text editor and graphical shell to use for writing and exploring Python named IDLE. In this video, I'll show you around this handy, but limited, tool.
Python actually gives us a text editor that we can use for writing Python code. 0:00 It's not the best editor around, and I highly recommend that you use something 0:05 a bit more substantial, like Sublime Text or PyCharm. 0:09 And I'll put links to some of these editors in the show notes. 0:13 But if you're just starting with Python or you just need to quickly make a script, 0:16 Idle, the editor that Python gives us, is okay. 0:20 It's a good way to play around with the language. 0:23 So we're gonna use our start menu. 0:25 Instead of searching for it I'll actually go through the start menu here. 0:27 And if we look over here I've got Python 3.5, and 0:30 this shows you how often I use Windows. 0:35 There we go, all apps, anyway if we look at all apps we see here we have Idle. 0:37 So we can go ahead and click Idle, and Idle pops up with the Shell window. 0:42 This is just like being in the Python Shell, so 0:46 we can do like Print("Hello") and it'll print Hello. 0:49 Just like when we're in the Shell like normal. 0:56 If we want to write like a script that we would save and 0:59 run, then we go to file and we choose New File or we hit Ctrl + N. 1:04 And this is just a normal, everyday file. 1:10 It's just a text file. 1:14 Sadly, Idle doesn't give us line numbers, but down here in this corner, 1:15 which let me see if I can get that up to us, move this down, 1:20 shrink, pull this up, there we go. 1:24 Well you can see that we've have line one and column zero, so 1:27 that tells us which line we're on, which column we're at. 1:29 It gives us enough information to get around. 1:32 One nice thing though, is that we can run our scripts directly from the editor. 1:36 Like let's say for num in range ten, 1:40 I want to print num squared. 1:48 And I'm gonna save this. 1:54 I'm going to put it into documents and I'm just 1:57 going to call this idle_test.pi. 2:03 And I can come here to run and hit run module, and you'll see it print there. 2:08 Or I can actually just hit the F5 key, and you'll see it runs as well. 2:14 So if you don't like F5 you can actually change that in the settings, which I do 2:20 believe are in, where are those settings, there it is, option, configure Idle. 2:24 So these are all the different settings you can use. 2:31 You can bump up your font face or font size if you want. 2:33 You can change the highlighting scheme. 2:37 You can change the keys that do certain things. 2:39 Somewhere down in here is the run command. 2:42 There it is. Run module is the key F5, 2:46 so you can put in a new key, if you want. 2:48 And then, in general, 2:51 you can control whether or not it opens up with an editing window or a show window. 2:52 and you can prompt whether or not it needs to save, things like that. 2:56 All in all it's nice stuff to have around. 2:59 None of it's super amazing, but it's pretty good. 3:03 And like I said I'll put links in the teacher's notes to other popular 3:06 Python editors. 3:10
You need to sign up for Treehouse in order to download course files.Sign up