background preloader

Python

Facebook Twitter

Scripts más descargados en python. Python.

Pdf

Distribuir aplicaciones Python. Una vez terminemos con el desarrollo de nuestra nueva aplicación es conveniente empaquetarla de forma que sea sencillo para los usuarios instalarla, y para nosotros distribuirla. En Python existen dos módulos principales para este cometido: distutils, que es parte de la librería estándar y era el método más utilizado hasta hace poco, y setuptools, que extiende la funcionalidad de distutils y es cada vez más popular. En este capítulo veremos el funcionamiento de ambas herramientas, y terminaremos explicando cómo crear ejecutables .exe para Windows a partir de nuestro programa en Python. distutils Todo programa distribuido con distutils contiene un script llamado por convención setup.py, que se encarga de instalar la aplicación llamando a la función setup de distutils.core.

Esta función tiene montones de argumentos, que controlan, entre otras cosas, cómo instalar la aplicación. Destinados a describir la aplicación tenemos los siguientes argumentos: Al ejecutar el comando python setup.py install. Python más rápido con Psyco. Psyco es un módulo que nos permite mejorar enormemente la velocidad de nuestras aplicaciones Python a cambio de un ligero incremento en el tiempo de inicialización. Esto se logra compilando parte del código de la aplicación en tiempo de ejecución (compilador JIT o Just In Time). Basta con añadir un par de líneas al comienzo de nuestro script para que Psyco compile tanto código como sea posible. import psyco psyco.full() import psyco psyco.full() Para aplicaciones complejas el uso de la función full puede no ser lo más adecuado, puesto que se necesitaría una gran cantidad de tiempo y memoria para compilar todo el código. Import psyco psyco.profile() import psyco psyco.profile() También puede ser de utilidad llamar primero a la función psyco.log() para Psyco cree un archivo en el que registrar el tiempo y la memoria utilizados para ejecutar el programa, así como cualquier problema con los que se pueda haber encontrado. import psyco psyco.log() psyco.profile() import psyco psyco.bind(mi_funcion)

Documentación en Python.

Web

Empresas de alojamiento (hosting) web con soporte para Python. Si bien uno espera que cualquier empresa, una vez elegido el plan adecuado, tenga soporte para Python, lo cierto es que en los planes básicos rara vez se incluye. Por eso me parece interesante tener un tema en el que las empresas que proveen alojamiento con Python puedan anunciarse, así aquellos a quienes nos interesa desarrollar con este lenguaje podemos ahorrar tiempo a la hora de buscar alojamiento.

Sabiendo que muchas empresas de alojamiento están representadas aquí en FdW, la idea es la siguiente: Cada usuario que represente a una empresa escribirá un mensaje en este tema, indicando: - Nombre de la empresa - Sitio web - Otra información de contacto (opcional) - Tipo de plan Donde "Tipo de plan" puede ser una de estas opciones: - Plan básico: El soporte para python está incluida en alguna de las ofertas de alojamiento básicas, o no está incluido pero puede agregarse sin costo - Plan básico + extra: El plan básico no incluye soporte, pero puede incluirse por una cuota extra Saludos. Overview — Numpy and Scipy Documentation. Making a simple web server in Python. Making a simple web server in Python. written by Jon Berg <jon.berg[at]turtlemeat.com> The great thing about Python is what they call "batteries included", that means a lot of functionallity is bundled with the programming language.

And the functionallity is fairly straight to use. Today we are going to demonstrate how to build a web server in less than 30 min. using the classes from the Python library. We are also going to have some "advanced" functionallity in this server. We want to do dynamic content serving (ala what ASP or PHP do), and be able to take POST from forms. The web server is implemented as an extention of the BaseHTTPRequestHandler. Lets look at the code: The main() tries to start the server at port 80 with a reference to the class we just implemented.

The do_GET() gets invoked when you do a GET request. The do_POST() gets invoked when you do a POST request. Download the example code. Update: Oct 2011. > I have one question. Making a simple web server in Java. Beautiful Soup documentation. By Leonard Richardson (leonardr@segfault.org) 这份文档也有中文版了 (This document is also available in Chinese translation) Этот документ также доступен в русском переводе. [Внешняя ссылка] (This document is also available in Russian translation. [External link]) Beautiful Soup 3 has been replaced by Beautiful Soup 4. Beautiful Soup 3 only works on Python 2.x, but Beautiful Soup 4 also works on Python 3.x. Beautiful Soup 3已经被Beautiful Soup 4替代.请在新的项目中查看Beautiful Soup 4的文档. Beautiful Soup 3只能在python2.x版本中运行,而Beautiful Soup 4还可以在python3.x版本中运行.Beautiful Soup 4速度更快,特性更多,而且与第三方的文档解析库(如lxml和html5lib)协同工作.推荐在新的项目中使用Beautiful Soup 4. Beautiful Soup is an HTML/XML parser for Python that can turn even invalid markup into a parse tree.

This document illustrates all major features of Beautiful Soup version 3.0, with examples. Table of Contents Quick Start Get Beautiful Soup here. Include Beautiful Soup in your application with a line like one of the following: from bs4 import BeautifulSoup # To get everything. Urllib2 - The Missing Manual. Because the default handlers handle redirects (codes in the 300 range), and codes in the 100-299 range indicate success, you will usually only see error codes in the 400-599 range. BaseHTTPServer.BaseHTTPRequestHandler.responses is a useful dictionary of response codes in that shows all the response codes used by RFC 2616. The dictionary is reproduced here for convenience : responses={100:('Continue','Request received, please continue'),101:('Switching Protocols','Switching to new protocol; obey Upgrade header'), 200: ('OK', 'Request fulfilled, document follows'), 201: ('Created', 'Document created, URL follows'), 202: ('Accepted', 'Request accepted, processing continues off-line'), 203: ('Non-Authoritative Information', 'Request fulfilled from cache'), 204: ('No Content', 'Request fulfilled, nothing follows'), 205: ('Reset Content', 'Clear input form for further input.'), 206: ('Partial Content', 'Partial content follows.'),

Python No Muerde. Package Index : PyPI. Python - O'Reilly Media. Documentación de Python. Documentation Index. Notice: While JavaScript is not essential for this website, your interaction with the content will be limited. Please turn JavaScript on for the full experience. Beginner Moderate Advanced General Python 3.x Resources Porting from Python 2 to Python 3 Can’t find what you’re looking for? >>> Python Needs You Open source software is made better when users can easily contribute code and documentation to fix bugs and add features. Contribute to Python Bug Tracker.

Qt

Www.pythonxy.com.