background preloader

VIM as Python IDE

VIM as Python IDE
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 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. Being able to neatly work on multiple files, the user still misses the potential his favourite IDE gives him in visualizing classes, functions and variables. A lot of coders have the habit of using TODO or FIXME statements in their code. In these times, the programmer knows his or her programming language more or less by interactively finding out what it can do. Probably the most wanted feature(besides code completion) is debugging graphically. .

Reader Vim made easy: how to get your favorite IDE features in Vim The Vim text editor is a favorite of many programmers and system administrators. Although it provides an exceptional amount of power and flexibility, it can be somewhat intimidating for new users. Programmers who transition to Vim from a conventional integrated development environment (IDE) tend to find the paradigm shift a bit disorienting. I often get e-mail from readers who are looking for ways to make Vim more developer-friendly. A common complaint is that the editor doesn't come with standard IDE features out of the box and it's not always clear how to configure it to provide equivalent functionality. The secret to unlocking Vim's real magic is to take advantage of its powerful plugin system and the large ecosystem of third-party scripts that offer editor augmentations for various tasks. GVim, with the default menu and toolbar configuration TagList plugin demonstrated with a Python program Vim's omnicompletion feature demonstrated with Python and the GTK+ library

Emacs as a powerful Python IDE May 09, 2008 at 03:27 PM | categories: python, enigma curry, emacs | 29 Comments Update 01/2009: this post is still valid, but see updated installation instructions here. Last night at the Python user group I gave a short demo on using Emacs as a Python editor/IDE. My macbook pro refused to display on the projector so I thought my demo was going to be a 'no go'. Thankfully, sontek allowed me to use his Linux laptop. My Emacs Environment Below are the Emacs features most applicable to Python development: Rope and Ropemacs Rope is a general (non-emacs specific) Python IDE library. A lot of people, for whatever reason, don't feel that Emacs is an IDE at all. I've tarred up my Emacs environment for general consumption. Install Pymacs Install Rope and Ropemacs BTW, those three packages should be the only packages other than Emacs you'll need. Extra tips: Put your .emacs.d directory under version control. Some more fun Emacs evangelism:

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)

Vim “A Byte of Vim” is a book which aims to help you to learn how to use the Vim editor (version 7), even if all you know is how to use the computer keyboard. The first part of this book is meant for new users who want to understand what Vim is and learn how to use it. The second part of this book is for people who already know how to use Vim and want to learn about features that make Vim so powerful, such as windows and tabs, personal information management, making it a programmer’s editor, how to extend Vim with your own plugins, and more. Download the book What Readers Say Thanks to A Byte of Vim, I have learnt how to use vim. “Well done!!! “The book is very good and fun to read too. “Your books should sell like hot cakes for their way of presentation.”– Deepak “I’d recommend A Byte of Vim as a good intro for new and experienced users alike.”– James Kovacs, Germany “Awesome! “Have been thumbing through ‘byte of vim’. learning a ton even having used vim for years.”– Josh Nichols Great Book!!

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.

Related: