Boston Python Workshop 5/Friday: Difference between revisions

From OpenHatch wiki
Content added Content deleted
(cOuXrGowCtxGwaDzKWq)
Line 1: Line 1:
We have some pretty cool loitacons lined up as well. Alley's, rooftops and a really edgy bar interior. As for what you'll need, probably just bring your camera. If you happen to have a skyport trigger, they may be useful, but not necessary by any means.
Welcome to the Friday evening section of the Boston Python Workshop!

When you get to MIT, please start your laptop and get on the wireless network. Try to join the one called "MIT", not "MIT GUEST". Then work through the goals on this page in order; they should take between 2 and 3 hours. Lots of staff will be around to help troubleshoot and to answer questions -- don't hesitate to ask!

At the end, a staff member will go through a checklist with you to make sure you're all set for tomorrow.

So we've established what you're wiilnlg to pay for as a consumer; it's service'.To get your business in the first place, there has to be someone to press the Big Red Switch when needed; and to keep your business, there has to be someone to install the latest Python. You don't need a guarantee that the Python will actually work; you'll take your own chances with that.I get the feeling there's going to be a bit of a culture clash when the Microsoft salesman shows up and tries selling you software'. Do keep us posted.

== 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.<br />

If you would like to use a different text editor from the recommendation for your operating system, please let a staff member know.

* [[Boston Python Workshop 5/Friday/Windows text editor|Windows]]
* [[Boston Python Workshop 5/Friday/OSX text editor|OS X]]
* [[Boston Python Workshop 5/Friday/Linux text editor|Linux]]

== 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:

* [[Boston Python Workshop 5/Friday/Windows interactive Python|Windows]]
* [[Boston Python Workshop 5/Friday/OSX interactive Python|OS X]]
* [[Boston Python Workshop 5/Friday/Linux interactive Python|Linux]]

== Goal #4: practice navigating the computer from a command prompt ==

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.

* [[Boston Python Workshop 5/Friday/Windows terminal navigation|Windows]]
* [[Boston Python Workshop 5/Friday/OSX terminal navigation|OS X]]
* [[Boston Python Workshop 5/Friday/Linux terminal navigation|Linux]]

== 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.

* [[Boston Python Workshop 5/Friday/Windows Python scripts|Windows]]
* [[Boston Python Workshop 5/Friday/OSX Python scripts|OS X]]
* [[Boston Python Workshop 5/Friday/Linux Python scripts|Linux]]

== Goal #6: get dependencies installed for the Saturday projects ==

* [[Boston Python Workshop 5/Friday/Windows project dependencies|Windows]]
* [[Boston Python Workshop 5/Friday/OSX project dependencies|OS X]]
* [[Boston Python Workshop 5/Friday/Linux project dependencies|Linux]]

== Goal #7: start learning Python! ==

It's time to start learning, reading, and writing some Python! Tonight, you'll work through a self-directed tutorial. Saturday morning, we'll have an interactive lecture to cover more Python basics.

[[Boston Python Workshop 5/Friday/Tutorial| Work through the tutorial]]

== Goal #8: Checkoff ==

Tell a staff member that you are ready to be checked off. Together you will go through the following check-off steps:

<ol>
<li>
Start a command prompt, and from that command prompt start Python. Then quit Python.
</li>
<li>
Create a new Python file (with a .py extension). In that file, type

<pre>
print "Hello World"
</pre>

and save the file. From a command prompt, navigate to and execute that Python script.
</li>
<li>
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.
</li>
<li>
To test the ColorWall installation: navigate to the ColorWall directory and run <code>run.py</code>:

<pre>
python run.py -a
</pre>
</li>
<li>
To test the Wordplay installation: navigate to the Wordplay directory and run <code>words1.py</code>:

<pre>
python words1.py
</pre>
</li>
<li>To test the Twitter installlation, navigate to the Twitter directory and run <code>twitter_api.py</code>:

<pre>
python twitter_api.py --search=python
</pre>
</li>

<li>
What was the hardest part of the tutorial? How were the CodingBat questions? Review these parts briefly. If you have any questions about them, now's a great time to ask them!
</li>
</ol>

Hey Brock,Seems there are a few small errors with your sircpt. The most important one is that you'll want to have lines 59 and 60 all the way to the left, with no whitespace in front of it. Right now python will think these lines are still part of your class.Then in line 21 you'll need to use curly braces {} for your bl_options, rather than parenthesis ().After doing this, the sircpt will not return any errors but the button won't show. This is because on line 13 the operator should be between quotation marks so that it reads layout.operator( object.random_material )On line 48 you made a small typo (availabeMaterials, instead of availableMaterials).Lastly, on line 50 you'll want to use square brackets [] instead of parenthesis () to access the randnum key.These are all minor mistakes though, so don't get discouraged! =)

Revision as of 02:42, 5 May 2012

We have some pretty cool loitacons lined up as well. Alley's, rooftops and a really edgy bar interior. As for what you'll need, probably just bring your camera. If you happen to have a skyport trigger, they may be useful, but not necessary by any means.