Anonymous user
Philadelphia Python Workshop 9/Setup/Windows project dependencies: Difference between revisions
Philadelphia Python Workshop 9/Setup/Windows project dependencies (view source)
Revision as of 16:20, 27 July 2013
, 10 years ago→Install the Twitter project dependencies
imported>Geography76 No edit summary |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 5:
===Download the Wordplay project===
We've written some skeleton code for the Wordplay project already. Download this code so you're ready to start working with it
# Right click the following file, click "Save Target as..." or "Save link as...", and save it to your Desktop directory:
Line 44:
<ol>
<li>Click and save
* https://github.com/abatula/PythonWorkshop-Twitter/archive/master.zip
</li>
<li>
The ".zip" extension on the above files indicates that they are compressed Zip archives. We need to "extract" their contents. To do this, click on "Start", then "Computer", and navigate to your Desktop directory.
</li>
</ol>
Line 59 ⟶ 56:
===Install the Twitter project dependencies===
Open a command prompt and navigate to the unzipped folder. For example, if you extracted the folder to C:\Users\myname\Desktop\PythonWorkshop-Twitter-master,
<pre>
cd C:\Users\
</pre>
Line 71 ⟶ 68:
</pre>
will show you the source code files in that directory.
Before we can install the dependencies, we must first install some setup tools using ez_setup.py. To do this, change directory into the ez_setup folder and type:
<pre>
python
</pre>
Now, we are ready to install the dependencies. Three of the dependency subfolders have an installer script that we'll need to run at a command prompt to install the software. For each dependency (in the order: simplejson-3.3.0 python-oauth2-master httplib2-0.8) navigate to the folder using cd. One of the files in this subfolder is "setup.py", which has a ".py" extension indicating that it is a Python script. Type:
Navigate to the 3 other dependency directories (in the order you downloaded them: simplejson-2.1.6, python-twitter, python-oauth2) and run▼
<pre>
Line 85 ⟶ 82:
</pre>
▲Navigate to the
<pre>
python setup.py install
</pre>
in all of them to install those dependencies as well. Now use cd to move into the python-twitter-1.0 folder. This time we will run the two following commands to install the dependency:
<pre>
python setup.py build
python setup.py install
</pre>
===Test the Twitter code===
<pre>
cd C:\Users\
</pre>
Line 109 ⟶ 110:
</pre>
will show you the source code files in that directory. One of the files is "
<pre>
CONSUMER_SECRET = 'We will give this to you in class :)'
</pre>
Change the string to the consumer secret string that we will give you in class. Save the file and go back to the command line. The file "twitter_api.py" is also a Python script. Type:
<pre>
Line 127 ⟶ 133:
===Download the ColorWall project===
You'll be writing graphical effects for an existing ColorWall project. Download this ColorWall code and example effects so you're ready to start working with
# Right click the following file, click "Save Target as..." or "Save link as...", and save it to your Desktop directory:
Line 175 ⟶ 181:
==State Capitals==
We'll look at an example Python script that quizzes you on state capitals during the lecture
# Right click the following file, click "Save Target as..." or "Save link as...", and save it to your Desktop directory:
Line 182 ⟶ 188:
==Success!==
You are done installing dependencies for the
[[Philadelphia Python Workshop 9/Setup|« Back to the setup page]]
|