Posted in Modulos, Python on 28 January, 2008 | Leave a Comment »
Hola amigos, las funciones aleatorias son muy útiles en más casos de los que piensas. Hoy voy a darte algunas notas sobre aleatorizar tus scripts python con el módulo random. Este simple módulo tiene algunas interesantes funciones para ver más de cerca:
random (): Genera un número flotante en el rango 0.0 <= x < 1.0.
uniform [...]
Read Full Post »
Posted in Modules, Python on 27 January, 2008 | Leave a Comment »
Hi folks, random functions are very useful in more cases that you think. Today I will give you some tips about randomizing python scripts with the random module. This simple module has some interesting functions to see deeper:
random (): Generate a float number in range 0.0 <= x < 1.0.
uniform (a, b): Generate a float [...]
Read Full Post »
Posted in Python, Threads on 26 January, 2008 | Leave a Comment »
Todo el mundo ha oído hablar de los threads, pero ¿Cómo conseguir threads en python? Hoy espero poder explicártelo. Antes de nada, los threads (o hilos) son básicamente flujos de ejecución. Cada uno de estos flujos de ejecución corre independientemente de los demás, así que si quieres realizar entrada/salida de disco (o cualquier otra operación [...]
Read Full Post »
Posted in Python, Threads on 25 January, 2008 | Leave a Comment »
Everyone has heard about threads, but how to get into python threads? Today I hope I can explain you. First of all, threads are basically execution flows. Each of this execution flows runs independently from another, so if you want to make a lot of disk IO (or any time-consuming task) and at the same [...]
Read Full Post »
Posted in Python, Rendimiento on 24 January, 2008 | Leave a Comment »
Este es mi primer post de una serie sobre rendimiento en python y cómo alcanzarla. Mi primer post trata sobre variables globales. No recomiendo el uso de estas variables excepto en contados casos, las razones son múltiples, pero en caso que tengas que usarlas, ten en cuenta este pequeño test:
from profileit import profileit
globalVar = 0
cycles [...]
Read Full Post »
Posted in Performance, Python on 23 January, 2008 | Leave a Comment »
This is my first post of a list about python performance and how to achieve it. My first post is about global variables. I don’t advise global variables except in few cases, reasons are multiples, but in case you have to use them, take into account this little test:
from profileit import profileit
globalVar = 0
cycles = [...]
Read Full Post »
Posted in Python on 22 January, 2008 | Leave a Comment »
Tengo que reconocer que descubrí está útil característica de python hace poco. Pero desde entonces le he encontrado un montón de usos. Estoy hablando sobre decoradores. Un decorador es una función que trabaja sobre otra función (o mejor dicho, alrededor de ella). Vamos a empezar fuerte, quiero enseñarte un decorador que verás más veces en [...]
Read Full Post »
Posted in Python on 21 January, 2008 | Leave a Comment »
I’ve to recognize that I discovered this useful feature of python recently. But since that, I’ve found a lot of uses. I’m talking about decorators. A decorator is a function that works over another function (or around it). To start strongly, I want to show you a snippet that you will see more times in [...]
Read Full Post »
Posted in Modules on 20 January, 2008 | Leave a Comment »
Como desarrollador sobre python, en tus scripts debes proporcionar información tanto al usuario como a ti mismo. Estoy seguro que estás pensando en la mandato print, pero esto no es muy recomendable. Hoy quiero mostrarte por qué y darte algunos trucos sobre el módulo logging de python. Este módulo está especializado en loguear (obviamente), pero [...]
Read Full Post »
Posted in Modules on 19 January, 2008 | Leave a Comment »
As a python developer, in your scripts, you must provide information for the user and for yours. I’m sure you’re thinking on print statement, but this isn’t recommended. Today, I want to show why and give you some good tips about logging python module. This module is intended for logging (obviously), but maybe you [...]
Read Full Post »