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 15:20, 27 July 2013
, 10 years agono edit summary
imported>Geography76 No edit summary |
imported>Geography76 No edit summary |
||
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. Click on the file and click the "Extract all files" button to extract the contents. This will create a directory
</li>
</ol>
Line 55 ⟶ 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 67 ⟶ 68:
</pre>
will show you the source code files in that directory. In this directory are five folders: Twitter (the main folder) and four dependency folders (simplejson-3.3.0, python-oauth2-master, httplib2-0.8, and python-twitter-1.0). 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:
<pre>
Line 73 ⟶ 74:
</pre>
and hit enter to install
Navigate to the
<pre>
Line 81 ⟶ 82:
</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 105 ⟶ 103:
</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>
|