The examples in this section use the scripting language Python. They will be based en the cURL examples.
We'll be working with Python3 and only with the `Python Standard
import yaml | |
import csv | |
from sys import stdout | |
salida = open('reglas.csv', 'w') | |
# salida = stdout | |
reglas = yaml.safe_load(open('reglas_de_negocio.yaml')) | |
campos = ['descripci贸n', 'observaciones'] | |
tabla = [ |
"""I downloaded the html5 version of PRO_GIT_book_ in order to review | |
with some partners the chapter dedicated to branching (chapter 3). | |
In order to guide a visual review of the chapter, i decided to grab | |
only the images and *code examples* and eliminate the rest. | |
The technique implemented is by striping the leaves off the *HTML DOM* | |
tree, expect those being `<img>`, `<code>` and `<h*>`. The containers | |
elements should not be deleted as it could damage the document | |
structure. |
/=
. En los de los lenguajes de programaci贸n m谩s populares, la desigualdad es !=
, pero Haskel decidi贸 utilizar /=
y creemos que la raz贸n es porque se parece m谩s al s铆mbolo matem谩tico de la desigualdad: .if
tiene que definir obligatoriamente el bloque else
.脡sta es una lista de recomendaciones que me atrevo a realizar a los alumnos del primer semestre de Computaci贸n de la UCV (II-2013) acerca de c贸mo desarrollar el producto que se les exige en el segundo proyecto de la materia Algoritmos y Programaci贸n.
Estas recomendaciones est谩n basadas en mi experiencia al realizar
class ResultadosParser(HTMLParser): | |
def __init__(self): | |
self.estamos_en_el_div = False | |
self.tds = 0 | |
self.candidato = {} # Un dict vacio | |
self.resultados = [] | |
def handle_startag(self, tag, args): # | |
dict_args = dict(args) |
# C贸digo que solo satisface el req 2 | |
class CNEEnlacesParser(HTMLParser): | |
def __init__(self): | |
self.enlaces = [] | |
def handle_starttag(self, tag, attrs): | |
dict_attrs = dict(attrs) | |
si el tag es un "a" y tiene como atributos "id"=="region_ref" y "href": |
<!DOCTYPE html> | |
<!-- | |
http://stackoverflow.com/questions/2897619/using-html5-javascript-to-generate-and-save-a-file | |
Ya que el API FileSave de HTML 5 no lo soportan todos los navegadores, use la | |
opci贸n del Uri Content. | |
--> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Data Uri, ejemplo</title> |