All posts tagged: python

Spellcheck web page by address

Leave a comment
Howtos / Python

Looking for error in web pages can be very boring. I’ve tried some online tools but they seems too old, unsatisfying or premium only so I go to a 3 days programming marathon and I put online a brand new tool to do the job I need. Go to Spellcheck This! and paste the URL address of the page you want to check and get the page checked for Deutsch, US English, Español, Français and […]

Django and Drupal integration using drush via SSH

Leave a comment
django / Drupal / Howtos / Python

Some months ago I talked about how to achieve a unified login from Django to Drupal using drush. The basic assumption was that both Drupal and Django are on the same server. What if the two components are on different servers? Paramiko is a SSH2 protocol library aimed to provide simple classes to make SSH connection. Let’s see how the code to call drush on command line changes. Prerequisites: paramiko on your app settings.py add: […]

Create nice unicode PDF using Python

Leave a comment
Coding / Howtos / Python

Today I started one of the less motivating activities in Python 2.x: encoding. In Python 3 unicode will be everywhere, but as of the 2.6 version I’ve on one of the server I have to endure. Objective: get data from a UTF-8 encoded json and print a nice PDF. Tools: json, urllib2, fpdf, cgi What you need: pyfpdf: https://code.google.com/p/pyfpdf/downloads/list Download fpdf-1.7.hg.zip or more recent Unzip, enter the directory and python setup.py install locate fpdf cd /usr/lib/python2.6/site-packages/fpdf (or the directory […]