diff --git a/assets/python-es-lecciones2.zip b/assets/python-es-lecciones2.zip index ce537c14d6..58dc2d91ed 100644 Binary files a/assets/python-es-lecciones2.zip and b/assets/python-es-lecciones2.zip differ diff --git a/assets/python-es-lecciones3.zip b/assets/python-es-lecciones3.zip index d707afda3a..2c30610583 100644 Binary files a/assets/python-es-lecciones3.zip and b/assets/python-es-lecciones3.zip differ diff --git a/assets/python-es-lecciones4.zip b/assets/python-es-lecciones4.zip index 78ba63aa3e..b6924c76e5 100644 Binary files a/assets/python-es-lecciones4.zip and b/assets/python-es-lecciones4.zip differ diff --git a/assets/python-es-lecciones5.zip b/assets/python-es-lecciones5.zip index 63fb71430c..9019709a74 100644 Binary files a/assets/python-es-lecciones5.zip and b/assets/python-es-lecciones5.zip differ diff --git a/assets/python-es-lecciones6.zip b/assets/python-es-lecciones6.zip index d8f82b98f9..be242f6e54 100644 Binary files a/assets/python-es-lecciones6.zip and b/assets/python-es-lecciones6.zip differ diff --git a/assets/python-es-lecciones7.zip b/assets/python-es-lecciones7.zip index 29db86a720..6e8b32d68b 100644 Binary files a/assets/python-es-lecciones7.zip and b/assets/python-es-lecciones7.zip differ diff --git a/assets/python-es-lecciones8.zip b/assets/python-es-lecciones8.zip index 2891039166..6289915596 100644 Binary files a/assets/python-es-lecciones8.zip and b/assets/python-es-lecciones8.zip differ diff --git a/assets/python-es-lecciones9.zip b/assets/python-es-lecciones9.zip index 96724f1656..eb4f4da4c7 100644 Binary files a/assets/python-es-lecciones9.zip and b/assets/python-es-lecciones9.zip differ diff --git a/assets/python-lessons2.zip b/assets/python-lessons2.zip index 6b5c51211c..aa57cd6e7b 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 9359e1ea3d..5cf9dc4b6b 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 ac6e3fca18..98875e52a7 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 1352ac7ba7..3b9fe21b53 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 640b79301d..c36ece62c0 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 af33497cdd..3d9c4b408c 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 a80b0e07b9..fc3fb012c4 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 2f1985bbe7..2b8a287cf5 100644 Binary files a/assets/python-lessons9.zip and b/assets/python-lessons9.zip differ diff --git a/en/lessons/from-html-to-list-of-words-1.md b/en/lessons/from-html-to-list-of-words-1.md index 6651e8b587..8f31f975bc 100755 --- a/en/lessons/from-html-to-list-of-words-1.md +++ b/en/lessons/from-html-to-list-of-words-1.md @@ -168,6 +168,7 @@ copy the following code into your file. # obo.py def stripTags(pageContents): + pageContents = str(pageContents) startLoc = pageContents.find("

") endLoc = pageContents.rfind("
") 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 d48af6ab79..de0519d576 100755 --- a/en/lessons/from-html-to-list-of-words-2.md +++ b/en/lessons/from-html-to-list-of-words-2.md @@ -35,7 +35,7 @@ doi: 10.46430/phen0007 In this lesson, you will learn the Python commands needed to implement the second part of the algorithm begun in the [From HTML to a List of Words (part 1)][]. The first half of the algorithm gets the content of -an HTML page and saves only the content betwee the first `

` and the last `
` +an HTML page and saves only the content between the first `

` and the last `
` tags. The second half of the algorithm does the following: - Look at every character in the *pageContents* string, one character at @@ -167,6 +167,7 @@ version as well to make sure that your program does what ours does. ``` python # obo.py def stripTags(pageContents): + pageContents = str(pageContents) startLoc = pageContents.find("

") endLoc = pageContents.rfind("
") diff --git a/en/lessons/normalizing-data.md b/en/lessons/normalizing-data.md index f92689e9ac..c565d40c92 100755 --- a/en/lessons/normalizing-data.md +++ b/en/lessons/normalizing-data.md @@ -116,7 +116,7 @@ import urllib.request, urllib.error, urllib.parse, obo url = 'http://www.oldbaileyonline.org/browse.jsp?id=t17800628-33&div=t17800628-33' response = urllib.request.urlopen(url) -html = response.read() +html = str(response.read()) text = obo.stripTags(html).lower() #add the string method here. wordlist = text.split() diff --git a/en/lessons/output-data-as-html-file.md b/en/lessons/output-data-as-html-file.md index 5a052b13ec..3bc686914b 100755 --- a/en/lessons/output-data-as-html-file.md +++ b/en/lessons/output-data-as-html-file.md @@ -171,7 +171,7 @@ def wrapStringInHTMLMac(program, url, body): now = datetime.datetime.today().strftime("%Y%m%d-%H%M%S") filename = program + '.html' - f = open(filename,'wb') + f = open(filename,'w') wrapper = """ diff --git a/es/lecciones/de-html-a-lista-de-palabras-1.md b/es/lecciones/de-html-a-lista-de-palabras-1.md index b18b19fde5..ef221f53e1 100644 --- a/es/lecciones/de-html-a-lista-de-palabras-1.md +++ b/es/lecciones/de-html-a-lista-de-palabras-1.md @@ -109,6 +109,7 @@ Crea un nuevo archivo llamado *obo.py* y guárdalo en tu carpeta *programming-hi # obo.py def quitarEtiquetas(contenidoPagina): + contenidoPagina = str(contenidoPagina) lugarInicio = contenidoPagina.find("

") lugarFin = contenidoPagina.rfind("
") diff --git a/es/lecciones/de-html-a-lista-de-palabras-2.md b/es/lecciones/de-html-a-lista-de-palabras-2.md index eeed9ac845..e7a80c3856 100644 --- a/es/lecciones/de-html-a-lista-de-palabras-2.md +++ b/es/lecciones/de-html-a-lista-de-palabras-2.md @@ -120,6 +120,7 @@ Tu rutina debe verse ligeramente diferente y, mientras que funcione, todo está ``` python # obo.py def quitarEtiquetas(contenidoPagina): + contenidoPagina = str(contenidoPagina) lugarInicio = contenidoPagina.find("

") lugarFin = contenidoPagina.rfind("
") diff --git a/es/lecciones/normalizar-datos.md b/es/lecciones/normalizar-datos.md index 2e1b9435b8..ac9b81daa5 100644 --- a/es/lecciones/normalizar-datos.md +++ b/es/lecciones/normalizar-datos.md @@ -95,7 +95,7 @@ import urllib.request, urllib.error, urllib.parse, obo url = 'http://www.oldbaileyonline.org/browse.jsp?id=t17800628-33&div=t17800628-33' respuesta = urllib.request.urlopen(url) -html = respuesta.read() +html = str(respuesta.read()) texto = obo.quitarEtiquetas(html).lower() #incluye el metodo de cadena aqui listaPalabras = texto.split() diff --git a/es/lecciones/salida-de-datos-como-archivo-html.md b/es/lecciones/salida-de-datos-como-archivo-html.md index 20b92af09c..67ec93dad3 100644 --- a/es/lecciones/salida-de-datos-como-archivo-html.md +++ b/es/lecciones/salida-de-datos-como-archivo-html.md @@ -122,7 +122,7 @@ def envuelveCadenaenHTMLMac(programa, url, body): ahora = datetime.datetime.today().strftime("%Y%m%d-%H%M%S") nombreArchivo = programa + '.html' - f = open(nombreArchivo,'wb') + f = open(nombreArchivo,'w') wrapper = """