Boston Python Workshop/Friday handout

From OpenHatch wiki

Welcome to Friday setup! Setup hours are from 5pm-8pm. Come any time within that block. Expect standard setup to take an hour, and the optional web app setup to take an additional hour.

The goals for this evening are to make sure you have a working environment for writing and running Python code and for writing ColorWall effects. There are also setup instructions and support for a second, optional project: a web app.

Site information

  • Friday setup and the Saturday workshop are both happening at Microsoft NERD, which is at One Memorial Drive in Cambridge, in the Thomas Paul room on the 1st floor.
  • To access the wireless network, connect to the Cambridge network and open a browser. You should be redirected to a login page, which will prompt you for a wireless code. The code is: pw304.

Setting up Python

This section has instructions for installing Python and running Python from a terminal prompt.

  1. Windows
  2. OS X
  3. Linux

In addition to being able to run Python, you should pick the text editor you'll use for writing and saving Python code during the workshop.

  • On Windows, you might use NotePad. To start NotePad: click Start, point to Programs, point to Accessories, and then click Notepad.
  • On OS X, you might use TextEdit. To start TextEdit: search for TextEdit from Spotlight, or navigate to Applications/TextEdit.
  • On Linux, you might use GEdit. To start GEdit: click Applications, point to Accessories, and click Text Editor.

Setting up the ColorWall

The ColorWall is a framework for writing effects for a wall of pixels. During the Saturday workshop, you will write your own effects for the ColorWall. (see it in action)

  1. Download the ColorWall project from http://mit.edu/jesstess/www/BostonPythonWorkshop.
  2. The ColorWall project has no dependencies to install on common, modern Windows, OS X, and Linux* distributions. To confirm that you have no dependencies to install, at a Python prompt run:
    import Tkinter
    If that command results in an ImportError, let a staff member know and we'll help get your dependencies set up. (*On some Debian installation, when you import Tkinter it will tell you that you need to install the python-tk package, which you should do)
  3. Run the example effects:
    • On Windows, assuming the ColorWall software was downloaded to \Downloads\ColorWall, run \Python27\python.exe \Downloads\ColorWall\run.py
    • On OS X, assuming the ColorWall software was downloaded to ~/Downloads/ColorWall, run python ~/Downloads/ColorWall/run.py
    • On Linux, assuming the ColorWall software was downloaded to ~/Downloads/ColorWall, run python ~/Downloads/ColorWall/run.py

Setting up the web app

If you want to make a web app on Saturday, you have to go through this process. This is an optional step in setup; however, it can be an exciting and fulfilling one.The web app is an example of an integrated Python-based application. It uses the Django web framework. Because the setup for this project is somewhat involved, this project and it's setup are optional. Attendees interested in the material or who have some programming experience are encouraged to work through the setup instructions with a staff member.

The web app setup instructions are here.

That's it! Friday is over.

In summary, make sure you leave on Friday comfortable with the following things:

  1. Running Python from a command prompt
  2. Running the ColorWall from a command prompt
  3. Editing Python code in a text editor

Let us know if you have any questions about Friday's setup or Saturday's workshop, and we look forward to seeing you on Saturday!