diff --git a/assets/python-lessons1.zip b/assets/python-lessons1.zip index 45c11f0d95..543b577232 100644 Binary files a/assets/python-lessons1.zip and b/assets/python-lessons1.zip differ diff --git a/assets/python-lessons2.zip b/assets/python-lessons2.zip index 93e07f9f51..6b5c51211c 100644 Binary files a/assets/python-lessons2.zip and b/assets/python-lessons2.zip differ diff --git a/assets/python-lessons3.zip b/assets/python-lessons3.zip index b3c97809a3..9359e1ea3d 100644 Binary files a/assets/python-lessons3.zip and b/assets/python-lessons3.zip differ diff --git a/assets/python-lessons4.zip b/assets/python-lessons4.zip index b73161f685..ac6e3fca18 100644 Binary files a/assets/python-lessons4.zip and b/assets/python-lessons4.zip differ diff --git a/assets/python-lessons5.zip b/assets/python-lessons5.zip index 3bc6a39a52..1352ac7ba7 100644 Binary files a/assets/python-lessons5.zip and b/assets/python-lessons5.zip differ diff --git a/assets/python-lessons6.zip b/assets/python-lessons6.zip index 7e7a1ada45..640b79301d 100644 Binary files a/assets/python-lessons6.zip and b/assets/python-lessons6.zip differ diff --git a/assets/python-lessons7.zip b/assets/python-lessons7.zip index df5b955772..af33497cdd 100644 Binary files a/assets/python-lessons7.zip and b/assets/python-lessons7.zip differ diff --git a/assets/python-lessons8.zip b/assets/python-lessons8.zip index a4085a6008..a80b0e07b9 100644 Binary files a/assets/python-lessons8.zip and b/assets/python-lessons8.zip differ diff --git a/assets/python-lessons9.zip b/assets/python-lessons9.zip index 38c0feb1dc..2f1985bbe7 100644 Binary files a/assets/python-lessons9.zip and b/assets/python-lessons9.zip differ diff --git a/en/lessons/creating-and-viewing-html-files-with-python.md b/en/lessons/creating-and-viewing-html-files-with-python.md index e3318fe9d0..954f617b0e 100755 --- a/en/lessons/creating-and-viewing-html-files-with-python.md +++ b/en/lessons/creating-and-viewing-html-files-with-python.md @@ -83,7 +83,7 @@ three quotation marks (see below). ``` python # write-html.py -f = open('helloworld.html','w') +f = open('helloworld.html','wb') message = """ @@ -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 = """ @@ -158,7 +158,7 @@ filename path correctly. import webbrowser -f = open('helloworld.html','w') +f = open('helloworld.html','wb') message = """ diff --git a/en/lessons/from-html-to-list-of-words-2.md b/en/lessons/from-html-to-list-of-words-2.md index 5802082604..65e39940e9 100755 --- a/en/lessons/from-html-to-list-of-words-2.md +++ b/en/lessons/from-html-to-list-of-words-2.md @@ -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() ``` diff --git a/en/lessons/output-data-as-html-file.md b/en/lessons/output-data-as-html-file.md index 5636be1c0b..e7c85cce41 100755 --- a/en/lessons/output-data-as-html-file.md +++ b/en/lessons/output-data-as-html-file.md @@ -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 = """ @@ -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 = """ diff --git a/en/lessons/working-with-text-files.md b/en/lessons/working-with-text-files.md index d378069eb4..d367ede1e9 100755 --- a/en/lessons/working-with-text-files.md +++ b/en/lessons/working-with-text-files.md @@ -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() ``` @@ -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 diff --git a/en/lessons/working-with-web-pages.md b/en/lessons/working-with-web-pages.md index cbf54e0086..9b4a05493d 100755 --- a/en/lessons/working-with-web-pages.md +++ b/en/lessons/working-with-web-pages.md @@ -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 ```