Un navegador en python

13 March 2008 – 21:29

¿Estás haciendo una aplicación en python y necesitas un navegador incrustado?

¿Qué prefieres, kHTML o Mozilla?

Mozilla: http://sourceforge.net/projects/pygtkmoz
kHTML: http://paul.giannaros.org/pykhtml/

Y un jashondo ha escrito un mini-howto para hacer incrustar mozilla:
http://patrick.wagstrom.net/tutorials/pygtkmozembed/pygtkmozembed.html

Veinte pasos de Perl a Python

13 March 2008 – 19:26

1. See a reference to Python being compared favorably to Perl. Think
to yourself, “another stupid little language that thinks it’s better
than Perl.” Ignore it. Repeat many times.

2. After seeing some reference to Python, decide, “what the hell, I’ll
have a look.”

3. Take a look at the language. Start with the tutorial. Become
utterly aghast at the use of indentation for nesting. Think, “Where
are the braces? Where are the begin and end statements?” Recall the
horrors of Fortran 77. Spaghetti code. Fixed column format. Think
about running away screaming.

4. Decide instead to push on in disbelief. Encounter the part of the
tutorial about modules. Become utterly aghast that Python does not
place high importance on data hiding. Think, “Python not supporting
data hiding goes against every fundamental principle of object
oriented programming I know (especially since I’ve also been led to
believe C++ is the beginning and end of OOP).”

5. Run away screaming.

6. Time passes.

7. Realize that you’d overreacted. Think, “Python probably does have
it’s place. It’s still no Perl.”

8. See another reference to Python, this time even more favorable than
before. Decide to give it another try, and maybe this time write some
code instead of just follow the tutorial.

9. Pick some little project, some little easy thing, you’ve been
meaning to do. Get to work on it in Python.

10. About halfway through the project, come to the sudden and ironic
realization that the use indentation for nesting, which you had
thought would you would never get used to, has become natural.

11. Finish the project with only the typical minor difficulties
involved in learning a new language, but without any major hair
pulling.

12. Acknowledge to yourself that Python is quite nice. Admit that
there are some things about it better than Perl. Acknowledge that it
is certainly better looking. Decide to use it again. Think, “It’s
still no Perl.”

13. Use Python again the next day for a slightly larger proejct. Only
yesterday, you would have chosen Perl for this project without another
thought. Even after finishing the previous day’s little project in
Python, you had briefly considered using Python for this larger one,
but decided to use Perl because it was too large to attempt with a
language you were unfamiliar with. Today, however, you decide to use
Python anyways. Python seems strangely alluring to you. Rationalize
this by telling yourself that a larger project such as this is a good
way to learn Python faster. Think, “It’s still no Perl.”

14. Time passes. Life happens. Choose Python for several little
projects that come along, all for the purpose of learning it better.
Think, “Python is still no Perl.”

15. Encounter a project much larger than anything you’ve used Python
for yet. Decide, “OK, I’ve been using and liking Python for all these
little projects I’ve been doing. Now that I have a much harder and
larger project, it is time to use the proven workhorse, Perl, a
language I am very familiar with and one that is ideally suited for
this project.”

16. Begin the project in Perl.

17. After writing about ten lines, begin pulling out your hair.
Become disgusted at the ugly travesty your fingers just produced.
Recall the horrors of Perl. Poor indentation. Ambiguous semantics.
Line noise. That section in the Perl man page where it gives several
examples of “good ways” to implement a switch statement, while
discouraging the most straightforward way. Think, “I cannot believe
I’ve been swallowing this garbage for years. What a masochist I was.
I was being screwed over by this pitiful hack of a language for all
that time, and I loved it.”

17. Run away screaming.

18. Finish the project in Python.

19. Refect upon your experience. Realize the dissidence of your
former admiration of Perl. Remember the occasions where you would
have questioned some of the now obvious design flaws in Perl, but
didn’t, because Perl was everything cool, and everyone was using it.
Think, “Python is still no Perl. Thank God.”

20. (Optional) Log on to your favorite chat room, and never miss an
opportunity to plug your new favorite language. Because your typical
style is to use understatement, your firm and absolute devotion to
Python will be perceived as a very strong message, that will make
people think.

Via: http://aspn.activestate.com/ASPN/Mail/Message/python-list/13239

Están locos estos hackers

13 March 2008 – 19:25

$ ddate
Today is Sweetmorn, the 71st day of Chaos in the YOLD 3174

El resto de comandos del paquete al que pertenece los obtenemos mediante:

dpkg -L `dpkg -S \`which ddate\`|cut -d: -f1`|grep –color=none bin/|rev|sed -e’s!\([^/]*\).*!\1!’|rev

¿Os interesa alguno?

ya tengo avatar

3 March 2008 – 22:44
avatar2.png

Conociendo al Priore

1 March 2008 – 23:59

Acababa de pedir unos bocadillos. Caros, pero el servicio a domicilio merecía la pena. Acababa de hacer una bola con el envoltorio del segundo bocadillo cuando vio una figura desconocida al girarse a tirar la comida al perro en vano. Acababa un día de soledad.

- Dios! Qué coño haces aquí? -Un desconocido, ataviado con una vestimenta digna de un fraile de la edad media, describió un arco con un bastón que dejó a escasos centímetros de la cara de estupor de Don.
- ¿Estás loco? Podrías haberme hecho daño!
- ¿Por qué?
- Por qué, qué? -Una sonrisa fue la única respuesta
- ¿Me estás escuchando?
- ¿Por qué podría haberte hecho daño?
- Casi me partes la cara con el bastón este. ¿Estás tarado? Mírate. ¿De dónde sales? ¿Quién cojones te crees que eres?
- Jamás interjecciones malsonantes dignificaron un discurso. Quién soy podría ser objeto de una larga discusión; suelen avisar de mi llegada como la del Priore. ¿Por qué podría haberte hecho daño?
- ¡Coño! -Don se detubo el tiempo justo para eliminar el resto de palabras vacías- Casi me das con eso en la cara…

Aquél que se había identificado como El Priore volvió a alzar el bastón y ejecutó una reverencia con su cuello detrás del que, perpendicular al suelo y cubriendo parte de su cabeza, dejaba ahora su apariencia inofensiva. El bastón golpeó la mesa y se colocó debajo de una pelota de papel de plata que se deslizó lentamente hasta la empuñadura.

- Esto quería y esto obtengo. -dijo mostrando la pelotita con la misma mano que sostenía el bastón
- Increíble, sí señor. ¿Y qué me quieres decir? ¿Tanto controlas tu palito?
- Deja de juzgarme bajo tus priopios esquemas. No he puesto en peligro tu ingridad física; tu preocupación es estúpida.
- Estúpido es también feo de decir. Pero al menos ahora te entiendo al hablar, macho.
- ¡Mierda, coño! -el bastón cayó al suelo- Se me ha caído el palito. ¡Joder, tío! No estás diciendo nada.
- Creo que te entiendo.

Don colocó su silla delante del sillón donde había aparecido el extraño personaje y pellizcó una de sus mejillas, apoyando uno de sus codos en el respaldo. Se descubrió buscando una respuesta de ese tipo.

- Pareces buena gente.
- Alumbrar la ceguera no eleva tu categoría. Vuelve a evaluar tus parámetros; tal vez estés midiendote en la escala equivocada.
- Cada cual vive donde le toca. Este es mi mundo. Y no creo que te esté entendido del todo.
- Cada cual decide donde vivir. El mundo existe en tu interior.
- Toma el bastón, anda.
- Gracias.

Se levantó gracias al apoyo que le ofrecía su bastón y se colocó la capucha en torno a su cabellera, crecida en libre dejadez. Resultaba extraña la flaqueza de sus fuerzas. Sonrió mirando a su interlocutor y salió de la habitación. Don quedó esperando oir la puerta de la entrada.