Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/python-lessons1.zip
Binary file not shown.
Binary file modified assets/python-lessons2.zip
Binary file not shown.
Binary file modified assets/python-lessons3.zip
Binary file not shown.
Binary file modified assets/python-lessons4.zip
Binary file not shown.
Binary file modified assets/python-lessons5.zip
Binary file not shown.
Binary file modified assets/python-lessons6.zip
Binary file not shown.
Binary file modified assets/python-lessons7.zip
Binary file not shown.
Binary file modified assets/python-lessons8.zip
Binary file not shown.
Binary file modified assets/python-lessons9.zip
Binary file not shown.
6 changes: 3 additions & 3 deletions en/lessons/creating-and-viewing-html-files-with-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ three quotation marks (see below).
``` python
# write-html.py

f = open('helloworld.html','w')
f = open('helloworld.html','wb')

message = """<html>
<head></head>
Expand Down Expand Up @@ -133,7 +133,7 @@ want something inside the directory (rather than the directory itself).
# write-html-2-mac.py
import webbrowser

f = open('helloworld.html','w')
f = open('helloworld.html','wb')

message = """<html>
<head></head>
Expand All @@ -158,7 +158,7 @@ filename path correctly.

import webbrowser

f = open('helloworld.html','w')
f = open('helloworld.html','wb')

message = """<html>
<head></head>
Expand Down
2 changes: 1 addition & 1 deletion en/lessons/from-html-to-list-of-words-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ And whenever you’ve needed to read from or write to a file, you’ve used
a special file handle like *f* in the example below.

``` python
f = open('helloworld.txt','w')
f = open('helloworld.txt','wb')
f.write('hello world')
f.close()
```
Expand Down
4 changes: 2 additions & 2 deletions en/lessons/output-data-as-html-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def wrapStringInHTMLMac(program, url, body):

now = datetime.datetime.today().strftime("%Y%m%d-%H%M%S")
filename = program + '.html'
f = open(filename,'w')
f = open(filename,'wb')

wrapper = """<html>
<head>
Expand Down Expand Up @@ -203,7 +203,7 @@ def wrapStringInHTMLWindows(program, url, body):
now = datetime.datetime.today().strftime("%Y%m%d-%H%M%S")

filename = program + '.html'
f = open(filename,'w')
f = open(filename,'wb')

wrapper = """<html>
<head>
Expand Down
4 changes: 2 additions & 2 deletions en/lessons/working-with-text-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ it as `file-output.py`.

``` python
# file-output.py
f = open('helloworld.txt','w')
f = open('helloworld.txt','wb')
f.write('hello world')
f.close()
```
Expand Down Expand Up @@ -159,7 +159,7 @@ foobar, Foobar and FOOBAR would all be different variables.

When you run this program, the `open` method will tell your computer to
create a new text file `helloworld.txt` in the same folder as you have
saved the `file-output.py` program. The *w parameter* says that you intend
saved the `file-output.py` program. The *wb parameter* says that you intend
to write content to this new file using Python.

Note that since both the file name and the parameter are surrounded by
Expand Down
2 changes: 1 addition & 1 deletion en/lessons/working-with-web-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ url = 'http://www.oldbaileyonline.org/browse.jsp?id=t17800628-33&div=t17800628-3
response = urllib.request.urlopen(url)
webContent = response.read()

f = open('obo-t17800628-33.html', 'w')
f = open('obo-t17800628-33.html', 'wb')
f.write(webContent)
f.close
```
Expand Down