Taking Python out for a spin on Windows with Notepad++
-
From the Windows' Start Menu, open up Notepad++, and you will see the window below.
-
On the top toolbar of the Notepad++ window, go to Language. Scroll down to the P section, and from that sub-list, select Python. This just tells Notepad++ what language we're writing in, so it can highlight syntax correctly, control indents, and such. Try typing in one simple command:
print "Hello, world!"
. -
Now choose the Save As option from the File menu on the top toolbar, and save this file as hello.py in your course folder. You should see the name change reflected in the top left corner of the Notepad++ window.
-
In a file explorer window, file the folder containing the file you just saved. Like in the picture below, right click the folder and select IPython here. Now you can get Python to interpret your program.
-
This action will open up a terminal window (be patient, this could take several seconds or so) that looks like
In case the terminal window does not come up, and you get a message that says “Invalid directory”, just close the window and try again.
-
To run your command stored in hello.py, all you have to do is type in
run hello
at the Python command prompt. -
Python prints
Hello world!
as requested. That's all you need to do to open/create, edit, and run your files!