background preloader

Python

Facebook Twitter

Example: Example, by Nobody. VIM as Python IDE | Alain M. Lafon. Finding the perfect IDE for Python isn’t an easy feat. There are a great many to chose from, but even though some of them offer really nifty features, I can’t help myself but feel attracted to VIM anyway. I feel that no IDE accomplishes the task of giving the comfort of complete power over the code – something is always missing out. This is why I always come back to using IDLE and VIM. Those two seem to be best companions when doing some quick and agile hacking – but when it comes to managing bigger and longer term projects, this combo needs some tweaking. But when it’s done, VIM will be a powerful IDE for Python – including code completion(with pydoc display), graphical debugging, task-management and a project view.

This is where we are going: So, these are my thoughts on a VIM setup for coding (Python). Modern GUI VIM implementations like GVIM or MacVIM give the user the opportunity to organize their open files in tabs. From the eye-candy to the implementation. . to vimrc. The search engine for Linux rpm and Debian packages - Silicon Island: My chrismas present: All-in-One win32 python installer. Since my Cherokee patch, I've been playing around with NSIS, the Windows tool for building installers. One of my obsessions with software is that entry barriers should be as low as possible in order to have a successful product and let people enjoy with it. I've been using Python and PyGTK for five years, I think that right now, are probably the easiest and funniest tools to get introduced into software development and gui programming on the free software world.

One of the most interesting feature is that they're both cross-platform, so you can write software that can run in 90% of its code on almost any UNIX, Windows and Mac OS X. Although, the problem with PyGTK is that is hard to setup on the most popular enviroment, Windows, which kills its potential success on the mass audience. Why is that hard to setup a PyGTK working enviroment right now? Well, let's take a look on the steps you need to take if you don't know anything about python and/or pygtk: As a summary, you have: Solutions?

BlackZone || My Live in Blog. 6 Nov 2009 | Escrito por: lopz | En: Python pygtk threads subprocess commands Hola Después de mucho tiempo sin escribir nada paso a poner una breve nota sobre el uso de threads en pygtk, en google hay mucha información al respecto, inclusive en su página hay esto: Y bueno, escribí un pequeño trozo de código que será fácil entender si se lee el anterior link, en esta ocasión pasaré de escribir línea a línea el script xD Code: import gtk import os import subprocess as sp import time import threading gtk.gdk.threads_init() #gobject.threads_init() CMD = 'du -sh /home/lopz/' class MainWin: Creates a main window object def __init__(self): w = gtk.Window() self.pb = gtk.ProgressBar() box = gtk.HBox(False, 0) self.btn_start = gtk.Button("Start") self.btn_start.connect("clicked", self.btn_start_click) box.pack_start(self.btn_start) btn_test = gtk.Button("Test") btn_test.connect("clicked", self.btn_test_click) box.pack_end(btn_test) box.pack_end(self.btn_stop)

Reader. The SQLite Query Optimizer Overview. Small. Fast. Reliable.Choose any three. This document provides overview of how the query planner and optimizer for SQLite works. Given a single SQL statement, there might be dozens, hundreds, or even thousands of ways to implement that statement, depending on the complexity of the statement itself and of the underlying database schema. The task of the query planner is to select an algorithm from among the many choices that provides the answer with a minimum of disk I/O and CPU overhead. With release 3.8.0, the SQLite query planner was reimplemented as the Next Generation Query Planner or "NGQP". 1.0 WHERE clause analysis The WHERE clause on a query is broken up into "terms" where each term is separated from the others by an AND operator.

All terms of the WHERE clause are analyzed to see if they can be satisfied using indices. If an index is created using a statement like this: CREATE INDEX idx_ex1 ON ex1(a,b,c,d,e,... 1.1 Index term usage examples ... ... ... ... ... 3.0 OR optimizations. Strings functions en Python. Esta publicación no tendrá mucho valor para quienes saben de Python o se dedican al desarrollo en este lenguaje. Para quienes no se encuentren en este grupo, quizás se sorprendan tanto como yo con la simplicidad con que Python maneja las cadenas de texto. A continuación, veremos algunos métodos del objeto string en Python a través de ejemplos muy sencillos. Cualquiera de estos ejemplos los puedes probar desde un shell interactivo de Python y si no tienes instalado el interprete Python en tu sistema, no es excusa, pues puedes usar codepad, el interprete online.

Extracción de subcadenas: las cadenas en Python son almacenadas en un array, así por ejemplo s[0]=”M”. Int len(string): retorna la longitud de una cadena. int count(sub [,start[,end]]): retorna el número de ocurrencias de una cadena dentro de otra, por ejemplo: boolean endswidth(sub [,start[,end]]): retorna verdadero o falso si una cadena termina con la cadena especificada. boolean startswidth(sub [,start[,end]]): similar a endswidth. Unicode/UTF-8 con Python | CRySoL. Cómo usar y aprovechar el soporte de Unicode que Python trae de serie.

Si no tienes muy claro de que va esto del Unicode, te recomiendo leer primero la receta Unicode y UTF-8. Introducción Python tiene soporte nativo para Unicode y sus encodings más populares. Si ejecutas un interprete de Python en un terminal, lo habitual es que herede el encoding por defecto. Para esta receta se supone que tus “locales” son es_ES.UTF-8. >>> import sys >>> sys.stdin.encoding ‘UTF-8’ Crear cadenas Unicode Cualquier cadena Unicode debe estar expresada con un encoding concreto. >>> sys.getdefaultencoding() ‘ascii’ Para indicar que una cadena es Unicode basta con escribir el caracter ‘u’ delante de la cadena, o bien construir un objeto de tipo unicode(): >>> u’hola’ u’hola’ >>> unicode(‘hola’) u’hola’ Como verás, al indicar una variable o literal, el interprete muestra la representación interna de esa variable.

Si sólo utilizas caracteres ‘ascii’, la representación interna es igual, como en el ejemplo anterior. SpanishLanguage. Links to Python information in Spanish Latin ISO 639-1 Code: es español Python es un lenguaje de programación de tipo interpretado, funcional, orientado a objetos e interactivo. Comúnmente es comparado (dando la preferencia ) a Lisp, Tcl, Ruby, Perl, C#, Visual Basic, Visual Fox Pro, Scheme, Java, MatLab e incluso Julia. Posee una mayor madurez que muchos de ellos, de creciente potencia y multifuncionalidad. Puede encontrarse información en Wikipedia hispana sobre Python. Se caracteriza por la fluencia de su sintaxis, la cual garantiza una alta legibilidad y comprensión del código tanto para quien desarrolla como para quien lee. Comunidad Python Hispano, cuyo objetivo es aglutinar a la comunidad Python hispanohablante, usando principalmente una lista de correos para tal fin.

Para quienes desean iniciar su aprendizaje en Python existen numerosas alternativas dentro de las cuales, sin ser las únicas, se incluyen las siguientes: Documentación y tutoriales Preguntas/Respuestas, Soporte, Foros Blogs. 2.0 Reference Manual.