1 00:00:00,410 --> 00:00:05,300 Your Python installation comes with a code editor that we can use right away. 2 00:00:06,560 --> 00:00:10,235 It's called IDLE, which stands for Integrated Development and 3 00:00:10,235 --> 00:00:12,240 Learning Environment. 4 00:00:12,240 --> 00:00:15,092 If you're just starting out with Python and 5 00:00:15,092 --> 00:00:19,880 you want a quick code editor to learn some basics, IDLE is a great choice. 6 00:00:21,620 --> 00:00:25,580 IDLE should already be installed when you installed Python. 7 00:00:25,580 --> 00:00:28,400 So you can search for IDLE using Spotlight. 8 00:00:30,510 --> 00:00:32,508 Launch the application. 9 00:00:32,508 --> 00:00:37,264 To compare and contrast IDLE with an online code editor, 10 00:00:37,264 --> 00:00:40,640 I will also open Treehouse Workspaces. 11 00:00:40,640 --> 00:00:43,445 If you've been using a different online editor, 12 00:00:43,445 --> 00:00:46,400 you'll find that the features are mostly the same. 13 00:00:47,480 --> 00:00:50,234 By default, IDLE opens a shell window, 14 00:00:50,234 --> 00:00:55,350 which is similar to our workspaces console when running the Python shell. 15 00:00:56,510 --> 00:00:59,910 Let's make sure the Python shell is running on our workspace's console. 16 00:01:01,010 --> 00:01:03,480 Type python3 and press enter. 17 00:01:05,710 --> 00:01:11,349 You're able to enter Python code directly into the shell, 18 00:01:11,349 --> 00:01:15,668 such as print("Hello World"). 19 00:01:15,668 --> 00:01:18,986 Let's do the same in our IDLE. 20 00:01:18,986 --> 00:01:21,352 print("Hello World"). 21 00:01:23,432 --> 00:01:27,777 We can see that the outputs are exactly the same. 22 00:01:27,777 --> 00:01:32,230 Be sure to check the teacher's notes if you're not sure what the Python shell is. 23 00:01:33,540 --> 00:01:38,320 There's not much we can do with just the Python shell, so let's create a new file. 24 00:01:39,350 --> 00:01:43,860 We can do that by clicking on File, New File. 25 00:01:46,507 --> 00:01:51,032 Be sure to save this file by going to File, Save. 26 00:01:53,321 --> 00:01:57,985 Let's call it app.py and save it in our Documents. 27 00:02:00,239 --> 00:02:05,068 This is similar to us creating a new file in Workspaces, 28 00:02:05,068 --> 00:02:08,268 so let's do that over there as well. 29 00:02:08,268 --> 00:02:13,419 File, New File, app.py. 30 00:02:18,231 --> 00:02:20,512 I'm going to use a simple function and 31 00:02:20,512 --> 00:02:24,156 function call which you can copy from the teacher's notes. 32 00:02:27,931 --> 00:02:31,058 Be sure to save both files. 33 00:02:31,058 --> 00:02:39,725 File, Save and over in Workspaces, File, Save. 34 00:02:39,725 --> 00:02:44,484 Unlike Workspaces, IDLE doesn't give us line numbers by default, and 35 00:02:44,484 --> 00:02:47,770 the syntax highlighting uses different colors. 36 00:02:48,940 --> 00:02:51,892 Let's have a look at IDLE settings. 37 00:02:55,874 --> 00:03:00,582 You can see that we can change the font, the colors, 38 00:03:00,582 --> 00:03:03,797 and some other advanced settings. 39 00:03:03,797 --> 00:03:08,174 This is one of the many benefits of a local code editor, 40 00:03:08,174 --> 00:03:12,846 you can really customize your development environment. 41 00:03:12,846 --> 00:03:19,250 I prefer a slightly larger font size, so let's do that. 42 00:03:21,338 --> 00:03:28,879 In workspaces, you can run your file in the console by typing python3 app.py. 43 00:03:28,879 --> 00:03:32,406 But first, let's exit the shell. 44 00:03:33,458 --> 00:03:38,526 Let's type python3 app.py. 45 00:03:38,526 --> 00:03:40,129 What's your name? 46 00:03:40,129 --> 00:03:46,163 Let's enter my cat's name, Rubik, and press enter. 47 00:03:46,163 --> 00:03:50,073 Here we have the printed results of the cheer function. 48 00:03:50,073 --> 00:03:56,722 Over in IDLE, with our app.py open, we'll click on Run, and 49 00:03:56,722 --> 00:04:02,121 Run Module, this will now run in the Python shell. 50 00:04:02,121 --> 00:04:04,658 Let's enter my other cat's name, Pickle. 51 00:04:06,506 --> 00:04:10,086 And we have the printed output once again. 52 00:04:10,086 --> 00:04:13,108 As you become more advanced in your Python skills, 53 00:04:13,108 --> 00:04:17,410 you'll find that IDLE won't quite meet the needs of your development. 54 00:04:18,660 --> 00:04:22,570 There are some great code editors out there that will be more applicable to your 55 00:04:22,570 --> 00:04:23,170 workflow. 56 00:04:24,280 --> 00:04:28,090 Be sure to check out the teacher's notes for some options. 57 00:04:28,090 --> 00:04:32,505 Congratulations, you now have a local Python installation that you 58 00:04:32,505 --> 00:04:37,190 can use to follow along with the courses here at Treehouse. 59 00:04:37,190 --> 00:04:41,598 You're also one step closer to using Python to develop software for 60 00:04:41,598 --> 00:04:44,960 your future clients or developer role. 61 00:04:44,960 --> 00:04:47,290 The Python world is at your fingertips.