Feeds:
Posts
Comments

Archive for January, 2008

Módulo random

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 »

Random module

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 »

Threads (Parte I)

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 »

Threads (Part I)

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 »

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 »

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 »

Decoradores

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 »

Decorators

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 »

Módulo logging

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 »

Logging module

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 »