Boston Python Workshop/Friday handout: Difference between revisions

removing spam
imported>Jesstess
imported>Brittag
(removing spam)
 
(48 intermediate revisions by 8 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
 
== SettingHow upto theget ColorWallto a Python prompt ==
 
Often in these directions, you'll need to type things at Python prompt. To get one:
 
* On Windows: Start -> Run -> cmd.exe
** Type this, and press enter:
** \python27\python
* On Linux or Mac OS:
** 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 32 ⟶ 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 colorwall 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
 
===Install Tkinter===
<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
<pre >>> import Tkinter</pre>
 
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()</licode> and hitting enter.
 
=== Run the ColorWall ===
<pre>import Tkinter</pre>
<li>Run the example effects:
 
<li>* On Windows, assuming the ColorWall software was downloaded to <code>C:\DownloadsUsers\ColorWall</code>, run <code>yourusername\Python27\python.exe \DownloadsDesktop\ColorWall\run.py</code></li>
If that command results in an <code>ImportError</code>, let a staff member know and we'll help get your dependencies set up. (*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)</li>
run \Python27\python.exe "C:\Users\yourusername\Desktop\colorwall\ColorWall\run.py"
<li>Run the example effects:
<li>* On LinuxOS X, assuming the ColorWall software was downloaded to <code>~/DownloadsDesktop/colorwall/ColorWall</code>, run <code>python ~/Downloads/ColorWall/run.py</code></li>
<ul>
python ~/Desktop/colorwall/ColorWall/run.py
<li>On Windows, assuming the ColorWall software was downloaded to <code>\Downloads\ColorWall</code>, run <code>\Python27\python.exe \Downloads\ColorWall\run.py</code></li>
<li>On* OSOn XLinux, 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>~/Downloads/ColorWall</code>, run <code>python ~/Downloads/ColorWall/run.py</code></li>
</ul>
</li>
</ol>
 
=== (Optional)Open Settingrun.py upin thetext web appeditor ===
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
# Linux
gedit run.py
 
# Mac/Windows right-click on run.py and "open with" your text editor of choice
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 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.
 
==== Programmer: You're ready for Saturday! ====
The web app setup instructions are [[Setting up the web app|here]].
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 ==
== That's it! Friday is over. ==
 
If you want to make a web app on Saturday, you'll need to install some additional packages. 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 it'sits setup are optional. AttendeesIf interestedyou inrun theinto materialtrouble, orget whothe havehelp someof programmingan experienceinstructor. are'''Instructions''': encouraged[[Setting to work throughup the setupweb instructions with a staff member.app]]
In summary, make sure you leave on Friday comfortable with the following things:
 
==== Web Developer: You're ready for Saturday!====
# Running Python from a command prompt
# Running the ColorWall from a command prompt
# Editing Python code in a text editor
 
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.
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