Boston Python Workshop/Friday handout: Difference between revisions

removing spam
imported>Paulproteus
imported>Brittag
(removing spam)
 
(34 intermediate revisions by 7 users not shown)
Line 20:
* 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. or you can start it from a terminal with:
gedit
 
== How to get to a Python prompt ==
Line 32 ⟶ 33:
** Open a Terminal, and type 'python'
 
== Intro to Programming stream: Setting up for 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 [http://vimeo.com/16522975 in action])
Line 42 ⟶ 43:
</gallery>
 
===Get project files===
<ol>
* Create a folder on your desktop called colorwall</li>
<li>* Download the ColorWall project from http://mit.edu/jesstess/www/BostonPythonWorkshop. into that folder
<ul>
<li>** Windows users, try http://mit.edu/jesstess/www/BostonPythonWorkshop/ColorWall.zip first, and download it to your Desktopcolorwall folder. The file should automatically get uncompressed when you download it.</li>
<li>** OS X and Linux users can use either the .zip orget .tar.gz file.</li> through Terminal
cd Desktop/colorwall
</ul>
wget http://mit.edu/jesstess/www/BostonPythonWorkshop/ColorWall.tar.gz
</li>
# unpack the tarball
<li>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:
tar -xvf ColorWall.tar.gz
 
<pre>import===Install Tkinter</pre>===
<li>The ColorWall project hasdepends noon Tkinter dependencieswhich tois installpre-installed on common, modernsome Windows, OS X, and Linux* distributions. To confirmcheck thatif you have noTkinter dependenciesinstalled, toopen install,your atTerminal/cmd awindow and start your Python prompt run:
python
>>> import Tkinter
 
If that command results in an <code>ImportError</code>, try following the [http://tkinter.unpythonic.net/wiki/How_to_install_Tkinter instructions for installing Tkinter here] and if you have problems let a staff member know and we'll help get your dependencies set upyou. (*On some Debian installation, when you <code>import Tkinter</code> it will tell you that you need to install the <code>python-tk</code> package, which you should do). After you are done at the Python prompt, exit to the regular terminal by typing <code>exit()</code> and hitting enter.</li>
<li>Run the example effects:
<ul>
<li>On Windows, assuming the ColorWall software was downloaded to <code>C:\Users\yourusername\Desktop\ColorWall</code>, run <code>\Python27\python.exe "C:\Users\yourusername\Desktop\ColorWall\run.py"</code></li>
<li>On OS X, assuming the ColorWall software was downloaded to <code>~/Downloads/ColorWall</code>, run <code>python ~/Downloads/ColorWall/run.py</code></li>
<li>On Linux, assuming the ColorWall software was downloaded to <code>~/Downloads/ColorWall</code>, run <code>python ~/Downloads/ColorWall/run.py</code></li>
</ul>
</li>
<li>Make sure you can open Python files in a text editor. Test this by running the text editor, navigating to your ColorWall directory, and opening <code>run.py</code>.</li>
</ol>
 
=== Setting up forRun the intro programming workshopColorWall ===
<li>Run the example effects:
 
<li>* On Windows, assuming the ColorWall software was downloaded to <code>C:\Users\yourusername\Desktop\ColorWall</code>, run <code>\Python27\python.exe "C:\Users\yourusername\Desktop\ColorWall\run.py"</code></li>
FIXME: Flesh this out
run \Python27\python.exe "C:\Users\yourusername\Desktop\colorwall\ColorWall\run.py"
<li>* On OS X, assuming the ColorWall software was downloaded to <code>~/DownloadsDesktop/colorwall/ColorWall</code>, run <code>python ~/Downloads/ColorWall/run.py</code></li>
python ~/Desktop/colorwall/ColorWall/run.py
<li>* On Linux, assuming the ColorWall software was downloaded to <code>~/DownloadsDesktop/colorwall/ColorWall</code>, run <code>python ~/Downloads/ColorWall/run.py</code></li>
python ~/Desktop/colorwall/ColorWall/run.py
 
=== Open run.py in text editor ===
Checklist:
<li>Make sure you can open Python files in a text editor. Test this by running the text editor, navigating to your ColorWall directory, and opening <code>run.py</code>.</li>
# Linux
gedit run.py
 
# Mac/Windows right-click on run.py and "open with" your text editor of choice
* Get the ZIP or tar.gz file for the intro programming exercises
* Get the data_types.txt
* Can you open up Python code in a text editor?
* Can you get to a Python prompt?
 
==== SettingProgrammer: upYou're theready webfor appSaturday! ====
If you're doing the programming section of the workshop tomorrow and you got this far, you're ready to go. Show an instructor your run.py working and also opened in a text editor, get your sticker and go have a good sleep.
 
== Intro to Web App stream: Setting up Django ==
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 [http://www.djangoproject.com/ Django] web framework. Because the setup for this project is somewhat involved, this project and its setup are optional. If you run into trouble, get the help of a staff member.
 
If you want to make a web app on Saturday, you'll haveneed to goinstall throughsome this process. This is an optional step in setup; however, it can be an exciting and fulfillingadditional onepackages. The web app is an example of an integrated Python-based application. It uses the [http://www.djangoproject.com/ Django] web framework. Because the setup for this project is somewhat involved, this project and its setup are optional. If you run into trouble, get the help of aan staff memberinstructor. '''Instructions''': [[Setting up the web app]]
If you are interested in the material, please try:
 
==== Web Developer: You're ready for Saturday!====
* [[Setting up the web app]]
 
If you're doing the web app stream of the workshop tomorrow and you got this far, you're ready to go. Show an instructor that your welcome page on alwaysdata.net is working, get your sticker and go have a good sleep.
== That's it! Friday is over. ==
 
In summary, make sure you leave on Friday comfortable with the following things:
 
# Running Python from a command prompt
# Running the ColorWall from a command prompt
# 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!
Anonymous user