Dabbling with Python again

My relationship with Python is a coming-and-going one. I was recently chatting with Oliver and he asked me what I didn’t like of Python and I said the answer was subjective, but didn’t have an otherwise straight, concise, informed answer. It’s more about feeling, actually. I want to have a better answer.

I currently prefer Ruby to Python, but I want to like Python. I’m not interested on finding out which one is better or picking a winner, I want to be fluent on both languages and use whichever does the best job for the task. I wouldn’t rewrite my Ruby xdotool wrapper in Python, for example. And I wouldn’t rewrite my code generator written in PHP because PHP is something Python and Ruby are not: a templating language. Best tool for the job.

While I can do (and have done) stuff with Python, I don’t consider myself a good Python programmer. There’s lots of gaps in my knowledge. I don’t feel comfortable with it. There goes that feel thing again, dargh. Whatever, I just want to learn Python properly.

I rewrote my latest Ruby script to Python, it automates getting the day’s Zoom invitation for sending it to my church’s WhatsApp group. Surely there’s better, pythonic ways of doing things, but it works and it gave me a better understanding on how to do things in Python based on how I usually write them in Ruby.

And I learnt about assignment expressions. I didn’t know Python couldn’t do that and I’m glad they added them to the language already. The reason behind them was exactly what I stumbled with: having a condition where a regular expression matches and needing the match object assigned to a variable. I was like, “why can’t I assign in a condition?”

Febrero 28, 2002

Hoy es el cumpleaños de Oliver. Estuve en su casa casi desde el medio día, pues me levanté tardísimo (a las doce!). Sucede que ayer nos quedamos hasta las dos de la mañana jugando con Powerhouse y Dorothy conectadas con un cable crossover. Quisiera decir que experimentamos de todo pero solamente levantamos un Squid y jugamos xtux. :D

Estoy aprendiendo Python. Antonio Ognio me picó el interés en este lenguaje. Es la segunda vez que lo hace… la primera fue PHP. Estoy implementando una idea que José Alcantara de la lista del PLUG soltó: un programa que automatice cambiar los nombres de los ficheros y sus enlaces HTML a minúsculas (Sucede que en Linux, a diferencia de Windows 9x y NT sí hace diferencia a nombres de ficheros con mayúsculas y minúsculas). Lo malo es que en estos dos ultimos días no he tenido tiempo de avanzar.