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-es-lecciones2.zip
Binary file not shown.
Binary file modified assets/python-es-lecciones3.zip
Binary file not shown.
Binary file modified assets/python-es-lecciones4.zip
Binary file not shown.
Binary file modified assets/python-es-lecciones5.zip
Binary file not shown.
Binary file modified assets/python-es-lecciones6.zip
Binary file not shown.
Binary file modified assets/python-es-lecciones7.zip
Binary file not shown.
Binary file modified assets/python-es-lecciones8.zip
Binary file not shown.
Binary file modified assets/python-es-lecciones9.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.
1 change: 1 addition & 0 deletions en/lessons/from-html-to-list-of-words-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ copy the following code into your file.
# obo.py

def stripTags(pageContents):
pageContents = str(pageContents)
startLoc = pageContents.find("<p>")
endLoc = pageContents.rfind("<br/>")

Expand Down
3 changes: 2 additions & 1 deletion en/lessons/from-html-to-list-of-words-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<p>` and the last `<br/>`
an HTML page and saves only the content between the first `<p>` and the last `<br/>`
tags. The second half of the algorithm does the following:

- Look at every character in the *pageContents* string, one character at
Expand Down Expand Up @@ -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("<p>")
endLoc = pageContents.rfind("<br/>")

Expand Down
2 changes: 1 addition & 1 deletion en/lessons/normalizing-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion en/lessons/output-data-as-html-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """<html>
<head>
Expand Down
1 change: 1 addition & 0 deletions es/lecciones/de-html-a-lista-de-palabras-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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("<p>")
lugarFin = contenidoPagina.rfind("<br/>")

Expand Down
1 change: 1 addition & 0 deletions es/lecciones/de-html-a-lista-de-palabras-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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("<p>")
lugarFin = contenidoPagina.rfind("<br/>")

Expand Down
2 changes: 1 addition & 1 deletion es/lecciones/normalizar-datos.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion es/lecciones/salida-de-datos-como-archivo-html.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """<html>
<head>
Expand Down