Boston Python Workshop/Friday handout: Difference between revisions

removing spam
imported>Paulproteus
imported>Brittag
(removing spam)
 
(39 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===
#Download the ColorWall project from http://mit.edu/jesstess/www/BostonPythonWorkshop.
* Create a folder on your desktop called colorwall</li>
#*Windows users, try http://mit.edu/jesstess/www/BostonPythonWorkshop/ColorWall.zip first, and download it to your Desktop. The file should automatically get uncompressed when you download it.
#* Download the ColorWall project from http://mit.edu/jesstess/www/BostonPythonWorkshop. into that folder
#*OS X and Linux users can use either the .zip or .tar.gz file.
#** 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.
#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:
#** OS X and Linux users can use either the .zip orget .tar.gz file. through Terminal
cd Desktop/colorwall
wget http://mit.edu/jesstess/www/BostonPythonWorkshop/ColorWall.tar.gz
# unpack the tarball
tar -xvf ColorWall.tar.gz
 
<pre>import===Install Tkinter</pre>===
#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>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 upRun the web appColorWall ===
<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>
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 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.
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 ===
The web app setup instructions are [[Setting up the web app|here]].
<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
== That's it! Friday is over. ==
 
==== Programmer: You're ready for Saturday! ====
In summary, make sure you leave on Friday comfortable with the following things:
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 ==
# Running Python from a command prompt
# Running the ColorWall from a command prompt
# Editing Python code in a text editor
 
If you want to make a web app on Saturday, you'll haveneed to goinstall throughsome thisadditional processpackages. 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 it'sits setup are optional. AttendeesIf interestedyou inrun theinto materialtrouble, orget whothe havehelp someof programmingan experienceinstructor. are'''Instructions''': encouraged[[Setting to work throughup the setup instructionsweb with a staff member.app]]
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!
 
==== Web Developer: You're ready for Saturday!====
 
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.
Anonymous user