Welcome to the Setup & Tutorial section of the Philadelphia Python Workshop!
When you arrive, please start your laptop and get on the wireless network. Network information will be on the whiteboard. Once you join the network, work through the goals on this page in order. Lots of staff will be around to help troubleshoot and to answer questions -- don't hesitate to ask! Don't worry if you don't get through Goal #7 and Goal #8. You'll have time to revisit this material later in the workshop.
At the end, a staff member will go through a checklist with you to make sure you've successfully worked through Goals 1-6.
Goal #1: set up Python
This section has instructions for installing Python and running Python from a command prompt.
Goal #2: prepare a text editor
In addition to being able to run Python, we are going to install a good text editor for writing and saving Python code during the workshop.
If you would like to use a different text editor from the recommendation for your operating system, please let a staff member know.
Goal #3: practice starting and exiting Python
We'll do a lot of learning and practicing at a Python prompt (this is "interactive" because you are typing the code and hitting enter to run it yourself, instead of running it from a file). So let's practice starting and exiting Python:
We will be running files containing Python code (Python "scripts") from the command prompt. You'll need to be able to navigate to those scripts using the command prompt so you can run them. In this section, we'll practice using these navigation commands.
Goal #5: practice running Python code from a file
Interactive Python programming at a Python prompt is great for short pieces of code and for testing ideas. For longer code, it can be easier to save the code in a file, and execute the contents of that file (aka a Python script). In this section, we'll practice running Python scripts.
Goal #6: get dependencies installed for the projects
Goal #7: start learning Python!
It's time to start learning, reading, and writing some Python! This is a self-directed tutorial. Later in the workshop, we'll have an interactive lecture to review more Python basics.
Goal #8: practice Python using CodingBat
Learning about functions opened up a whole new way for us to practice, using the programming site codingbat.com. The big goal of this practice section is to get you thinking about how to solve problems in Python.
You don't have to create a CodingBat account to do the exercises, but if you do create an account it'll keep track of which problems you've completed and other statistics.
Goal #9: Checkoff
Tell a staff member that you are ready to be checked off. Together you will go through the following check-off steps:
- Start a command prompt, and from that command prompt start Python. Then quit Python.
Create a new Python file (with a .py extension). In that file, type
print "Hello World"
and save the file. From a command prompt, navigate to and execute that Python script.
- Open your text editor, and press "Tab". Use the left arrow key to show the instructor that you are using spaces to indent, not tabs.
- To test the Wordplay installation, navigate to the Wordplay directory and run
- To test the Twitter installation, navigate to the Twitter directory and run
python twitter_api.py --search=python
- Walk through the CodingBat problem that you had the most difficulty with. The first batch of CodingBat questions are here.
If you have any other questions about the tutorial, project setup, or CodingBat questions, now is a great time to ask!
You are done with the Setup & Tutorial portion of this Workshop.
If you have any questions, comments, or feedback on tonight's material, don't hesitate to let a staff member know.