Skip to content

Commit 3ea86c4

Browse files
committed
Change the URL to py4e.com, typoes
1 parent 36dc9ff commit 3ea86c4

22 files changed

+702
-50
lines changed

book3/01-intro.mkd

+2-2
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ language skills.
255255
Before you can converse with Python, you must first install the Python
256256
software on your computer and learn how to start Python on your
257257
computer. That is too much detail for this chapter so I suggest that you
258-
consult [www.pythonlearn.com](http://www.pythonlearn.com) where I have detailed
258+
consult [www.py4e.com](http://www.py4e.com) where I have detailed
259259
instructions and screencasts of setting up and starting Python on
260260
Macintosh and Windows systems. At some point, you will be in a terminal
261261
or command window and you will type *python* and the
@@ -577,7 +577,7 @@ Python techniques that were used to make the program. You are the end
577577
user, you simply use the program and marvel at its cleverness and how it
578578
saved you so much manual effort. You simply type the code into a file
579579
called *words.py* and run it or you download the source
580-
code from <http://www.pythonlearn.com/code3/> and run it.
580+
code from <http://www.py4e.com/code3/> and run it.
581581

582582
\index{program}
583583

book3/03-conditional.mkd

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ statements* because they stretch across more than one line.
147147

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

book3/07-files.mkd

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ stored. When you open a file, you are asking the operating system to
4949
find the file by name and make sure the file exists. In this example, we
5050
open the file `mbox.txt`, which should be stored in the same
5151
folder that you are in when you start Python. You can download this file
52-
from [www.pythonlearn.com/code3/mbox.txt](http://www.pythonlearn.com/code3/mbox.txt)
52+
from [www.py4e.com/code3/mbox.txt](http://www.py4e.com/code3/mbox.txt)
5353

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

9797
The entire file of mail interactions is available from
9898

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

101101
and a shortened version of the file is available from
102102

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

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

569569
You can download the file from
570570

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

573573
Exercise 2: Write a program to prompt for a file name, and then read
574574
through the file and look for lines of the form:

book3/08-lists.mkd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ Exercises
10731073
---------
10741074
10751075
Exercise 4: Download a copy of the file from
1076-
[www.pythonlearn.com/code3/romeo.txt](http://www.pythonlearn.com/code3/romeo.txt)
1076+
[www.py4e.com/code3/romeo.txt](http://www.py4e.com/code3/romeo.txt)
10771077
10781078
\index{Romeo and Juliet}
10791079

book3/09-dictionaries.mkd

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ word on every line of the input file.
304304

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

309309
~~~~
310310
python count1.py

book3/12-network.mkd

+10-10
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ This is a long and complex 176-page document with a lot of detail. If
4646
you find it interesting, feel free to read it all. But if you take a
4747
look around page 36 of RFC2616 you will find the syntax for the GET
4848
request. To request a document from a web server, we make a connection
49-
to the `www.pythonlearn.com` server on port 80, and then send a
49+
to the `www.pr4e.org` server on port 80, and then send a
5050
line of the form
5151

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

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

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

339339
~~~~
340340
python urlregex.py
341-
Enter - http://www.pythonlearn.com/book.htm
341+
Enter - http://www.py4e.com/book.htm
342342
http://www.greenteapress.com/thinkpython/thinkpython.html
343343
http://allendowney.com/
344-
http://www.pythonlearn.com/code
344+
http://www.py4e.com/code
345345
http://www.lib.umich.edu/espresso-book-machine
346-
http://www.pythonlearn.com/py4inf-slides.zip
346+
http://www.py4e.com/py4inf-slides.zip
347347
~~~~
348348

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

405405
~~~~
406406
python urllinks.py
407-
Enter - http://www.pythonlearn.com/book.htm
407+
Enter - http://www.py4e.com/book.htm
408408
http://www.greenteapress.com/thinkpython/thinkpython.html
409409
http://allendowney.com/
410410
http://www.si502.com/
411411
http://www.lib.umich.edu/espresso-book-machine
412-
http://www.pythonlearn.com/code
413-
http://www.pythonlearn.com/
412+
http://www.py4e.com/code
413+
http://www.py4e.com/
414414
~~~~
415415

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

483483
~~~~
484-
curl -O http://www.pythonlearn.com/cover.jpg
484+
curl -O http://www.py4e.com/cover.jpg
485485
~~~~
486486

487487
The command `curl` is short for "copy URL" and so these two
488488
examples are cleverly named `curl1.py` and
489-
`curl2.py` on [www.pythonlearn.com/code](http://www.pythonlearn.com/code) as
489+
`curl2.py` on [www.py4e.com/code3](http://www.py4e.com/code3) as
490490
they implement similar functionality to the `curl` command.
491491
There is also a `curl3.py` sample program that does this task
492492
a little more effectively, in case you actually want to use this pattern

book3/13-web.mkd

+4-4
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ Enter location:
336336
~~~~
337337

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

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

380380
To make use of these programs you will need to have a Twitter account,
@@ -570,8 +570,8 @@ Exercises
570570
---------
571571

572572
**Exercise 1:** Change either the
573-
[www.pythonlearn.com/code3/geojson.py](http://www.pythonlearn.com/code3/geojson.py) or
574-
[www.pythonlearn.com/code3/geoxml.py](http://www.pythonlearn.com/code3/geoxml.py) to print
573+
[www.py4e.com/code3/geojson.py](http://www.py4e.com/code3/geojson.py) or
574+
[www.py4e.com/code3/geoxml.py](http://www.py4e.com/code3/geoxml.py) to print
575575
out the two-character country code from the retrieved data. Add error
576576
checking so your program does not traceback if the country code is not
577577
there. Once you have it working, search for "Atlantic Ocean" and make

book3/14-objects.mkd

+11-11
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ and passing in the list (`stuff`) and the item we want retrieved from the list
8989
as parameters.
9090

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

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

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

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

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

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

@@ -341,7 +341,7 @@ Object Lifecycle
341341

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

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

381381
Many Instances
@@ -515,7 +515,7 @@ attribute
515515

516516
class
517517
: A template that can be used to construct an object. Defines
518-
the attrbutes and methods that will make up the object.
518+
the attributes and methods that will make up the object.
519519
\index{class}
520520

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

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

559559
parent class
560-
: The class which is being extended to create a new chld class.
560+
: The class which is being extended to create a new child class.
561561
The parent class contributes all of its methods and attributes
562-
to the new chaild class.
562+
to the new child class.
563563
\index{parent class}
564564

565565

book3/15-database.mkd

+1-1
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ Take the rows from `Follows` and append the row from
915915
`People` where the field `from_id` in `Follows` is
916916
the same the `id` value in the `People` table.
917917

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

920920
The result of the JOIN is to create extra-long "metarows" which have
921921
both the fields from `People` and the matching fields from

book3/16-viz.mkd

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ the data on a Google map.
2626

2727
To get started, download the application from:
2828

29-
[www.pythonlearn.com/code3/geodata.zip](http://www.pythonlearn.com/code3/geodata.zip)
29+
[www.py4e.com/code3/geodata.zip](http://www.py4e.com/code3/geodata.zip)
3030

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

151151
You can download and extract this application from:
152152

153-
[www.pythonlearn.com/code3/pagerank.zip](http://www.pythonlearn.com/code3/pagerank.zip)
153+
[www.py4e.com/code3/pagerank.zip](http://www.py4e.com/code3/pagerank.zip)
154154

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

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

305305
You can download this application from:
306306

307-
[www.pythonlearn.com/code3/gmane.zip](http://www.pythonlearn.com/code3/gmane.zip)
307+
[www.py4e.com/code3/gmane.zip](http://www.py4e.com/code3/gmane.zip)
308308

309309
We will be using data from a free email list archiving service called
310310
[www.gmane.org](http://www.gmane.org). This service is very popular with open

book3/createspace/2016-08-31-x.mobi

8.8 MB
Binary file not shown.

book3/createspace/2016-08-31-x.pdf

2.25 MB
Binary file not shown.

book3/verbatim.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
if fn.startswith('../') :
7676
# Add a blank unless there is one at end of file
7777
if blank : print
78-
fu = fn.replace('../','http://www.pythonlearn.com/')
78+
fu = fn.replace('../','http://www.py4e.com/')
7979
print '# Code:', fu
8080
if trinket:
8181
print "# Or select Download from this trinket's left-hand menu"
@@ -102,4 +102,4 @@
102102
with open(tmpfile, 'r') as f:
103103
print f.read()
104104

105-
os.remove(tmpfile)
105+
os.remove(tmpfile)

code3/geodata/where.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<p><b>About this Map</b></p>
4747
<p>
4848
This is a cool map from
49-
<a href="http://www.pythonlearn.com">www.pythonlearn.com</a>.
49+
<a href="http://www.py4e.com">www.py4e.com</a>.
5050
</p>
5151
</body>
5252
</html>

code3/intro.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ our new language skills.
238238
Before you can converse with Python, you must first install the Python
239239
software on your computer and learn how to start Python on your
240240
computer. That is too much detail for this chapter so I suggest
241-
that you consult www.pythonlearn.com where I have detailed
241+
that you consult www.py4e.com where I have detailed
242242
instructions and screencasts of setting up and starting Python
243243
on Macintosh and Windows systems. At some point, you will be in
244244
a terminal or command window and you will type python and
@@ -434,7 +434,7 @@ used to make the program. You are the end user, you simply use the program and
434434
at its cleverness and how it saved you so much manual effort.
435435
You simply type the code
436436
into a file called words.py and run it or you download the source
437-
code from http://www.pythonlearn.com/code/ and run it.
437+
code from http://www.py4e.com/code/ and run it.
438438

439439
This is a good example of how Python and the Python language are acting as an intermediary
440440
between you (the end user) and me (the programmer). Python is a way for us to exchange useful

code3/urllink2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://pypi.python.org/pypi/beautifulsoup4
33

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

88
from urllib.request import urlopen

code3/urllink3.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://pypi.python.org/pypi/beautifulsoup4
33

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

88
import urllib.request, urllib.parse, urllib.error

code3/urllinks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://pypi.python.org/pypi/beautifulsoup4
33

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

88
import urllib.request, urllib.parse, urllib.error

code3/wikigrade.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Note - this code must run in Python 2.x and you must download
2-
# http://www.pythonlearn.com/code/BeautifulSoup.py
2+
# http://www.py4e.com/code/BeautifulSoup.py
33
# Into the same folder as this program
44

55
import string

lessons.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"title":"Peer Review: Installing and Running Python Screen Shots",
103103
"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.",
104104
"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.",
105-
"assignment":"http://www.pythonlearn.com/install",
105+
"assignment":"http://www.py4e.com/install",
106106
"parts":[
107107
{
108108
"title":"Image of the program being edited in a text editor",

0 commit comments

Comments
 (0)