In this post, I will explain you why the good practice in Python programs is to carefully import only what is necessary to run your program. Let’s start with an example. Sometimes, I feel lazy and use: from toto import * This is a bad idea, as sometimes the name of the things that you…
The LaTeX logo, typeset with LaTeX (Photo credit: Wikipedia) I have implemented a simple DeTeX function in Python. I provide this function below, as is and without any guarantee. If you run it, and it should change the example LaTeX text into “simple” text thanks the detex() function defined in the code. It’s a quick…
Regular expressions are really useful whenever you want to search for or replace text in a file or a string. That means, all the time! They are concise, elegant, powerful and simple. So let’s have a look to some examples. I provide below a simple code example to show the usage of regular expressions in…
tumblr google webmaster tools sitemap (Photo credit: GioSaccone) Sitemaps are useful to indicate to websearch engines the list of the pages on your site / blog. Thus, it is a good Search Engine Optimization (SEO) practice to provide the sitemaps of your site to the main search engines. If you use blogger, the sitemap URLs…
Meta tags are useful for search engine optimization purposes: they associate key words to a website. For instance, if your blog is about cooking, you may want to add meta tags such as “recipes, cooking, bakery, cup cakes” to your blog. This will help google, yahoo, bing, etc to recognize the topics of interest on…
Configuring the famous Pidgin instant messaging client to support IRC is very easy on Linux Debian: sudo apt-get install pidgin pidgin-otr Open pidgin, add an IRC account with the nickname and password you want. For the server, you probably want to use: irc.freenode.net When that is done, go to contact > add a chatroom. In…
English: Python logo Deutsch: Python Logo (Photo credit: Wikipedia) Xterm (Photo credit: SiRGt) Geany is a great Integrated Development Environmnent (IDE) for Python on Linux. I love everything in Geany except the size of the execution windows that opens when running a program: it is far too small. To configure the size of the terminal…
How to convert HTML code to Text with Python (solved) There are several tools to convert html to text (html2text) in python. My favorite is beautiful soup. Under linux systems, you install the beautiful soup python module with the following two commands: easy_install beautifulsoup4easy_install html5lib Then, in your source code, you can call beautiful soup…