Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Preview
Start a free Courses trial
to watch this video
Get to know Python’s built-in text editor, IDLE, to use for writing and exploring Python.
Resources
Cheer function
def cheer(name):
for letter in name:
print(f"Gimme a {letter}!")
print("What does that spell?")
print(f"{name}!")
user_input = input("What's your name? ")
cheer(user_input)
Code Editors
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Your Python installation comes with
a code editor that we can use right away.
0:00
It's called IDLE, which stands for
Integrated Development and
0:05
Learning Environment.
0:10
If you're just starting
out with Python and
0:12
you want a quick code editor to learn
some basics, IDLE is a great choice.
0:15
IDLE should already be installed
when you install Python.
0:20
So you can search for
IDLE using the Start menu.
0:25
Launch the application.
0:29
To compare and
contrast IDLE with an online code editor,
0:32
I will also open Treehouse workspaces.
0:37
If you've been using
a different online editor,
0:41
you'll find that the features
are mostly the same.
0:44
By default, IDLE opens a shell window,
0:48
which is similar to our workspaces
console when running the Python shell.
0:51
Let's make sure the Python shell is
running on our workspaces console.
0:56
Type python3 and press Enter.
1:02
You're able to enter Python
code directly into the shell,
1:06
such as print ("Hello World").
1:12
Let's do the same in our IDLE,
print("Hello World").
1:17
We can see that the outputs
are exactly the same.
1:24
Be sure to check the teacher's notes if
you are not sure what the Python shell is.
1:29
There's not much we can do with just the
Python shell, so let's create a new file.
1:35
We can do that by clicking
on File > New File.
1:40
Be sure to save this file
by going to File > Save.
1:48
Let's call it app.py and
save it in our documents.
1:55
This is similar to us creating
a new file in workspaces,
2:02
so let's do that over there as well,
2:06
File > New File, app.py.
2:11
I'm going to use a simple function and
function call,
2:18
which you can copy from
the teacher's notes.
2:21
Be sure to save both files.
2:28
File > Save, and
over in workspaces, File > Save.
2:31
Unlike workspaces, IDLE doesn't
give us line numbers by default,
2:39
and the syntax highlighting
uses different colors.
2:45
Let's have a look at IDLE's settings.
2:48
You can see that we can change the font,
2:53
the colors, and
some other advanced settings.
2:57
This is one of the many benefits
of a local code editor.
3:02
You can really customize your
development environment.
3:06
I prefer a slightly larger font size,
so let's do that.
3:11
In workspaces,
you can run your file in the console by
3:18
typing python3 app.py, but
first, let's exit the shell.
3:23
Let's type python3 app.py.
3:31
What's your name?
3:36
Let's enter my cat's name Rubik,
and press Enter.
3:37
Here, we have the printed
results of the cheer function.
3:44
Over in IDLE with our app.py open,
3:48
we'll click on Run > Run Module.
3:52
This will now run in the Python shell.
3:56
Let's enter my other cat's name,
Pickle, and
3:59
we have the printed output once again.
4:04
As you become more advanced
in your Python skills,
4:07
you'll find that IDLE won't quite
meet the needs of your development.
4:11
There are some great code editors out
there that will be more applicable to your
4:16
workflow.
4:20
Be sure to check out the teacher's
notes for some options.
4:21
Congratulations, you now have
a local Python installation that
4:25
you can use to follow along with
the courses here at Treehouse.
4:30
You're also one step closer to using
Python to develop software for
4:34
your future clients or developer role.
4:40
The Python world is at your fingertips.
4:43
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up