#!usr/bin/python import csv import os import stat import time def table(): url = "http://spreadsheets.google.com/pub?key=phy-HLMk8799lCYy3KAIqZQ&output=csv&gid=0" file = "rates.csv" out = [] if (int(time.time()) - os.stat(file)[stat.ST_MTIME]) / 60 >= 5: os.system("wget -qO \'%s\' \'%s\'" % (file, url)) reader = csv.reader(open(file)) out += [reader.next()] length = len(out[0]) for row in reader: out += [row + [""] * (length - len(row))] return out if __name__ == '__main__': for row in table(): print "