Skip to content

Commit

Permalink
Change the URL to py4e.com, typoes
Browse files Browse the repository at this point in the history
  • Loading branch information
csev committed Aug 31, 2016
1 parent 36dc9ff commit 3ea86c4
Show file tree
Hide file tree
Showing 22 changed files with 702 additions and 50 deletions.
4 changes: 2 additions & 2 deletions book3/01-intro.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ language skills.
Before you can converse with Python, you must first install the Python
software on your computer and learn how to start Python on your
computer. That is too much detail for this chapter so I suggest that you
consult [www.pythonlearn.com](http://www.pythonlearn.com) where I have detailed
consult [www.py4e.com](http://www.py4e.com) where I have detailed
instructions and screencasts of setting up and starting Python on
Macintosh and Windows systems. At some point, you will be in a terminal
or command window and you will type *python* and the
Expand Down Expand Up @@ -577,7 +577,7 @@ Python techniques that were used to make the program. You are the end
user, you simply use the program and marvel at its cleverness and how it
saved you so much manual effort. You simply type the code into a file
called *words.py* and run it or you download the source
code from <http://www.pythonlearn.com/code3/> and run it.
code from <http://www.py4e.com/code3/> and run it.

\index{program}

Expand Down
2 changes: 1 addition & 1 deletion book3/03-conditional.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ statements* because they stretch across more than one line.

There is no limit on the number of statements that can appear in the
body, but there must be at least one. Occasionally, it is useful to have
a body with no statements (usually as a placekeeper for code you haven't
a body with no statements (usually as a place holder for code you haven't
written yet). In that case, you can use the `pass` statement,
which does nothing.

Expand Down
8 changes: 4 additions & 4 deletions book3/07-files.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ stored. When you open a file, you are asking the operating system to
find the file by name and make sure the file exists. In this example, we
open the file `mbox.txt`, which should be stored in the same
folder that you are in when you start Python. You can download this file
from [www.pythonlearn.com/code3/mbox.txt](http://www.pythonlearn.com/code3/mbox.txt)
from [www.py4e.com/code3/mbox.txt](http://www.py4e.com/code3/mbox.txt)

>>> fhand = open('mbox.txt')
>>> print(fhand)
Expand Down Expand Up @@ -96,11 +96,11 @@ individuals in an open source project development team:

The entire file of mail interactions is available from

[www.pythonlearn.com/code3/mbox.txt](http://www.pythonlearn.com/code3/mbox.txt)
[www.py4e.com/code3/mbox.txt](http://www.py4e.com/code3/mbox.txt)

and a shortened version of the file is available from

[www.pythonlearn.com/code3/mbox-short.txt](http://www.pythonlearn.com/code3/mbox-short.txt)
[www.py4e.com/code3/mbox-short.txt](http://www.py4e.com/code3/mbox-short.txt)

These files are in a standard format for a file containing multiple mail
messages. The lines which start with "From " separate the messages and
Expand Down Expand Up @@ -568,7 +568,7 @@ program will look as follows:

You can download the file from

[www.pythonlearn.com/code3/mbox-short.txt](http://www.pythonlearn.com/code3/mbox-short.txt)
[www.py4e.com/code3/mbox-short.txt](http://www.py4e.com/code3/mbox-short.txt)

Exercise 2: Write a program to prompt for a file name, and then read
through the file and look for lines of the form:
Expand Down
2 changes: 1 addition & 1 deletion book3/08-lists.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ Exercises
---------
Exercise 4: Download a copy of the file from
[www.pythonlearn.com/code3/romeo.txt](http://www.pythonlearn.com/code3/romeo.txt)
[www.py4e.com/code3/romeo.txt](http://www.py4e.com/code3/romeo.txt)
\index{Romeo and Juliet}
Expand Down
2 changes: 1 addition & 1 deletion book3/09-dictionaries.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ word on every line of the input file.

When we run the program, we see a raw dump of all of the counts in
unsorted hash order. (the `romeo.txt` file is available at
[www.pythonlearn.com/code3/romeo.txt](http://www.pythonlearn.com/code3/romeo.txt))
[www.py4e.com/code3/romeo.txt](http://www.py4e.com/code3/romeo.txt))

~~~~
python count1.py
Expand Down
20 changes: 10 additions & 10 deletions book3/12-network.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This is a long and complex 176-page document with a lot of detail. If
you find it interesting, feel free to read it all. But if you take a
look around page 36 of RFC2616 you will find the syntax for the GET
request. To request a document from a web server, we make a connection
to the `www.pythonlearn.com` server on port 80, and then send a
to the `www.pr4e.org` server on port 80, and then send a
line of the form

`GET http://data.pr4e.org/romeo.txt HTTP/1.0 `
Expand All @@ -67,7 +67,7 @@ display what the server sends back.
\VerbatimInput{../code3/socket1.py}

First the program makes a connection to port 80 on the server
[www.pythonlearn.com](http://www.pythonlearn.com). Since our program is playing the role
[www.py4e.com](http://www.py4e.com). Since our program is playing the role
of the "web browser", the HTTP protocol says we must send the GET
command followed by a blank line.

Expand Down Expand Up @@ -338,12 +338,12 @@ http://www.dr-chuck.com/page2.htm

~~~~
python urlregex.py
Enter - http://www.pythonlearn.com/book.htm
Enter - http://www.py4e.com/book.htm
http://www.greenteapress.com/thinkpython/thinkpython.html
http://allendowney.com/
http://www.pythonlearn.com/code
http://www.py4e.com/code
http://www.lib.umich.edu/espresso-book-machine
http://www.pythonlearn.com/py4inf-slides.zip
http://www.py4e.com/py4inf-slides.zip
~~~~

Regular expressions work very nicely when your HTML is well formatted
Expand Down Expand Up @@ -404,13 +404,13 @@ http://www.dr-chuck.com/page2.htm

~~~~
python urllinks.py
Enter - http://www.pythonlearn.com/book.htm
Enter - http://www.py4e.com/book.htm
http://www.greenteapress.com/thinkpython/thinkpython.html
http://allendowney.com/
http://www.si502.com/
http://www.lib.umich.edu/espresso-book-machine
http://www.pythonlearn.com/code
http://www.pythonlearn.com/
http://www.py4e.com/code
http://www.py4e.com/
~~~~

You can use BeautifulSoup to pull out various parts of each tag as
Expand Down Expand Up @@ -481,12 +481,12 @@ follows:
\index{curl}

~~~~
curl -O http://www.pythonlearn.com/cover.jpg
curl -O http://www.py4e.com/cover.jpg
~~~~

The command `curl` is short for "copy URL" and so these two
examples are cleverly named `curl1.py` and
`curl2.py` on [www.pythonlearn.com/code](http://www.pythonlearn.com/code) as
`curl2.py` on [www.py4e.com/code3](http://www.py4e.com/code3) as
they implement similar functionality to the `curl` command.
There is also a `curl3.py` sample program that does this task
a little more effectively, in case you actually want to use this pattern
Expand Down
8 changes: 4 additions & 4 deletions book3/13-web.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ Enter location:
~~~~

You can download
[www.pythonlearn.com/code3/geoxml.py](http://www.pythonlearn.com/code3/geoxml.py) to
[www.py4e.com/code3/geoxml.py](http://www.py4e.com/code3/geoxml.py) to
explore the XML variant of the Google geocoding API.

Security and API usage
Expand Down Expand Up @@ -374,7 +374,7 @@ libraries.
For this next sample program we will download the files
*twurl.py*, *hidden.py*,
*oauth.py*, and *twitter1.py* from
[www.pythonlearn.com/code](http://www.pythonlearn.com/code) and put them all in a folder
[www.py4e.com/code](http://www.py4e.com/code3) and put them all in a folder
on your computer.

To make use of these programs you will need to have a Twitter account,
Expand Down Expand Up @@ -570,8 +570,8 @@ Exercises
---------

**Exercise 1:** Change either the
[www.pythonlearn.com/code3/geojson.py](http://www.pythonlearn.com/code3/geojson.py) or
[www.pythonlearn.com/code3/geoxml.py](http://www.pythonlearn.com/code3/geoxml.py) to print
[www.py4e.com/code3/geojson.py](http://www.py4e.com/code3/geojson.py) or
[www.py4e.com/code3/geoxml.py](http://www.py4e.com/code3/geoxml.py) to print
out the two-character country code from the retrieved data. Add error
checking so your program does not traceback if the country code is not
there. Once you have it working, search for "Atlantic Ocean" and make
Expand Down
22 changes: 11 additions & 11 deletions book3/14-objects.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ and passing in the list (`stuff`) and the item we want retrieved from the list
as parameters.

The last three lines of the program are completely equivalent, but it is more
convienent to simply use the square bracket syntax to look up an item at
convenient to simply use the square bracket syntax to look up an item at
a particular position in a list.

We can take a look into the capbilities of an object by
We can take a look into the capabilities of an object by
looking at the output of the `dir()` function:

>>> stuff = list()
Expand Down Expand Up @@ -196,7 +196,7 @@ read or what we plan to do with the data we extract from the web page.

Another word we use to capture this idea that we ignore the internal
detail of objects we use is "encapsulation". This means that we can
know how to use an object without knowing how it internally acomplishes
know how to use an object without knowing how it internally accomplishes
what we need done.

Our First Python Object
Expand All @@ -221,7 +221,7 @@ and methods (code).
\VerbatimInput{../code3/party2.py}

Each method looks like a function, starting with the `def` keyword and
consisting of an indended block of code. This example has one attribute (x)
consisting of an indented block of code. This example has one attribute (x)
and one method (party). The methods have a special first parameter that
we name by convention `self`.

Expand Down Expand Up @@ -341,7 +341,7 @@ Object Lifecycle

In the previous examples, we are defining a class (template) and using that class
to create an instance of that class (object) and then using the instance. When
the program finishes, all the varaibles are discarded. Usually we don't think
the program finishes, all the variables are discarded. Usually we don't think
much about the creation and destruction of variables, but often as our objects
become more complex, we need to take some action within the object to set things
up as the object is being constructed and possibly clean things up as the object is
Expand Down Expand Up @@ -375,7 +375,7 @@ stop our variable from being destroyed, but we can do any necessary
cleanup right before our object no longer exists.

When developing objects, it is quite common to add a constructor to an object
to set in intial values in the object, it is relatively rare to need to
to set in initial values in the object, it is relatively rare to need to
need a destructor for an object.

Many Instances
Expand Down Expand Up @@ -515,7 +515,7 @@ attribute

class
: A template that can be used to construct an object. Defines
the attrbutes and methods that will make up the object.
the attributes and methods that will make up the object.
\index{class}

child class
Expand All @@ -538,7 +538,7 @@ destructor
inheritance
: When we create a new class (child) by extending an
existing class (parent). The child class has all the attributes
and methods of the parent class plus additional asttributes and
and methods of the parent class plus additional attributes and
methods defined by the child class.
\index{inheritance}

Expand All @@ -553,13 +553,13 @@ object
: A constructed instance of a class. An object contains all of
the attributes and methods that were defined by the class.
Some object-oriented documentation uses the term 'instance'
interchangably with 'object'.
interchangeably with 'object'.
\index{method}

parent class
: The class which is being extended to create a new chld class.
: The class which is being extended to create a new child class.
The parent class contributes all of its methods and attributes
to the new chaild class.
to the new child class.
\index{parent class}


Expand Down
2 changes: 1 addition & 1 deletion book3/15-database.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ Take the rows from `Follows` and append the row from
`People` where the field `from_id` in `Follows` is
the same the `id` value in the `People` table.

![Conencting Tables Using JOIN](height=3.5in@figs2/join)
![Connecting Tables Using JOIN](height=3.5in@figs2/join)

The result of the JOIN is to create extra-long "metarows" which have
both the fields from `People` and the matching fields from
Expand Down
6 changes: 3 additions & 3 deletions book3/16-viz.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ the data on a Google map.

To get started, download the application from:

[www.pythonlearn.com/code3/geodata.zip](http://www.pythonlearn.com/code3/geodata.zip)
[www.py4e.com/code3/geodata.zip](http://www.py4e.com/code3/geodata.zip)

The first problem to solve is that the free Google geocoding API is
rate-limited to a certain number of requests per day. If you have a lot
Expand Down Expand Up @@ -150,7 +150,7 @@ visualization output.

You can download and extract this application from:

[www.pythonlearn.com/code3/pagerank.zip](http://www.pythonlearn.com/code3/pagerank.zip)
[www.py4e.com/code3/pagerank.zip](http://www.py4e.com/code3/pagerank.zip)

![A Page Ranking](height=3.5in@../images/pagerank)

Expand Down Expand Up @@ -304,7 +304,7 @@ far and pull down nearly a gigabyte of data and visualize it.

You can download this application from:

[www.pythonlearn.com/code3/gmane.zip](http://www.pythonlearn.com/code3/gmane.zip)
[www.py4e.com/code3/gmane.zip](http://www.py4e.com/code3/gmane.zip)

We will be using data from a free email list archiving service called
[www.gmane.org](http://www.gmane.org). This service is very popular with open
Expand Down
Binary file added book3/createspace/2016-08-31-x.mobi
Binary file not shown.
Binary file added book3/createspace/2016-08-31-x.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions book3/verbatim.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
if fn.startswith('../') :
# Add a blank unless there is one at end of file
if blank : print
fu = fn.replace('../','http://www.pythonlearn.com/')
fu = fn.replace('../','http://www.py4e.com/')
print '# Code:', fu
if trinket:
print "# Or select Download from this trinket's left-hand menu"
Expand All @@ -102,4 +102,4 @@
with open(tmpfile, 'r') as f:
print f.read()

os.remove(tmpfile)
os.remove(tmpfile)
2 changes: 1 addition & 1 deletion code3/geodata/where.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<p><b>About this Map</b></p>
<p>
This is a cool map from
<a href="http://www.pythonlearn.com">www.pythonlearn.com</a>.
<a href="http://www.py4e.com">www.py4e.com</a>.
</p>
</body>
</html>
4 changes: 2 additions & 2 deletions code3/intro.txt
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ our new language skills.
Before you can converse with Python, you must first install the Python
software on your computer and learn how to start Python on your
computer. That is too much detail for this chapter so I suggest
that you consult www.pythonlearn.com where I have detailed
that you consult www.py4e.com where I have detailed
instructions and screencasts of setting up and starting Python
on Macintosh and Windows systems. At some point, you will be in
a terminal or command window and you will type python and
Expand Down Expand Up @@ -434,7 +434,7 @@ used to make the program. You are the end user, you simply use the program and
at its cleverness and how it saved you so much manual effort.
You simply type the code
into a file called words.py and run it or you download the source
code from http://www.pythonlearn.com/code/ and run it.
code from http://www.py4e.com/code/ and run it.

This is a good example of how Python and the Python language are acting as an intermediary
between you (the end user) and me (the programmer). Python is a way for us to exchange useful
Expand Down
2 changes: 1 addition & 1 deletion code3/urllink2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://pypi.python.org/pypi/beautifulsoup4

# Or download the file
# http://www.pythonlearn.com/code3/bs4.zip
# http://www.py4e.com/code3/bs4.zip
# and unzip it in the same directory as this file

from urllib.request import urlopen
Expand Down
2 changes: 1 addition & 1 deletion code3/urllink3.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://pypi.python.org/pypi/beautifulsoup4

# Or download the file
# http://www.pythonlearn.com/code3/bs4.zip
# http://www.py4e.com/code3/bs4.zip
# and unzip it in the same directory as this file

import urllib.request, urllib.parse, urllib.error
Expand Down
2 changes: 1 addition & 1 deletion code3/urllinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://pypi.python.org/pypi/beautifulsoup4

# Or download the file
# http://www.pythonlearn.com/code3/bs4.zip
# http://www.py4e.com/code3/bs4.zip
# and unzip it in the same directory as this file

import urllib.request, urllib.parse, urllib.error
Expand Down
2 changes: 1 addition & 1 deletion code3/wikigrade.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Note - this code must run in Python 2.x and you must download
# http://www.pythonlearn.com/code/BeautifulSoup.py
# http://www.py4e.com/code/BeautifulSoup.py
# Into the same folder as this program

import string
Expand Down
2 changes: 1 addition & 1 deletion lessons.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"title":"Peer Review: Installing and Running Python Screen Shots",
"description":"Install Python and a programming text editor and write a program that prints one line other than 'hello world', then take two screen shots and upload them below. You should use the command line to execute the Python program you wrote in the text editor. Please do *not* use the IDLE Python Shell, the Python Interpreter (>>>), or a shortcut in your text editor to run the code. Later in the class when we start reading files, we will need to be able to run Python programs from particular directories. See the videos for details.",
"grading":"This is a relatively simple assignment. The goal is to simply show that each student has Python installed on their desktop or laptop and can take screen shots. Please make your comments to help the student that you are reviewing.",
"assignment":"http://www.pythonlearn.com/install",
"assignment":"http://www.py4e.com/install",
"parts":[
{
"title":"Image of the program being edited in a text editor",
Expand Down
Loading

0 comments on commit 3ea86c4

Please sign in to comment.