11.07.2015 Views

versión color - PET: Python Entre Todos - Python Argentina

versión color - PET: Python Entre Todos - Python Argentina

versión color - PET: Python Entre Todos - Python Argentina

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Usando librerías adicionales y virtualenv 101>>> mailServer.ehlo()>>> mailServer.starttls()>>> mailServer.ehlo()>>> mailServer.login(USUARIO, PASSWORD)>>> msg = MIMEText(" Este es el contenido del mail... ")>>> msg['From'] = USERNAME>>> msg['To'] = USERNAME>>> msg['Subject'] = "Este es el sujeto">>> mailServer.sendmail("tzulberti@gmail.com", "tzulberti@gmail.com", msg.as_string())Leemos una pagina web para leer el contenido de la misma.>>> from urllib2 import urlopen>>> response = urlopen("http://python.org.ar/pyar/")>>> contenido_html = response.read()>>> print contenido_htmlInicio - PyAr - <strong>Python</strong> <strong>Argentina</strong>Trabajamos con archivos comprimidos>>> import zipfile>>> archivo_comprimido = zipfile.ZipFile("EL_ARHIVO.zip", "r")>>> for name in archivo_comprimido.namelist():... print name>>> archivo_comprimido.extract()Pero la librería de python no tiene todo:• No sabe leer algunos algunos formatos de archivos (yaml, mp3, vídeo)• Frameworks web (pylons, django, web2py)• Usar API de Youtube, Deliciosus, etc….{footer} — http://revista.python.org.ar

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!