Python

A python curls up to touch the tip of its own tail with its nose, forming the shape of a circle.

A python curls up to touch the tip of its own tail with its nose, forming the shape of a circle. The python is 2.6 pi (2.6π) meters long. What is the radius r of the circle that the python forms? – Obviously, this is not about the programming language. Someone was searching for this, well, lots of people were, so why not answer it? Snakes are scary. Instead of thinking of it as a snake, assume it’s just the circumference of a circle - the length of the line that draws the circle.

Add rows to a Google Spreadsheet with Python, without API

Sometimes it’s a hassle to track auth data for the Google Spreadsheet API. Here’s a quick hack using Google Forms to post data to a Spreadsheet (similar to the previous post that uses Curl). You can use it as a function in your code, or as a simple command-line tool. Gist (archive.org) #!/usr/bin/python """Posts to a Google Sheet using a Form""" import re import sys import urllib import urllib2 def get_field_ids(form_url): """Returns list of field IDs on the form.

How to use Google webmaster tools stats with Excel

Google’s webmaster tools (archive.org) has a neat feature that lets you download your query and click statistics (once you have verified ownership of your site). The data you can get from there is quite comprehensive, but hard to break down for use in Excel. As a fun exercise I put together a small Python-script that takes the CSV file downloaded from your webmaster tools account and turns it into new CSV files for queries and for clicks (both with the position numbers as well).