All pastes #768017 Raw Edit

Miscellany

public python v1 · immutable
·published 2007-11-10 05:59 UTC
rendered paste body
from picture import *import warmupdef read_file (f):       for line in f:        yield line.split(":")def file_to_dictionary(file):    lines = {}    temp = ''    temp_list = []    for x in read_file(file):        for y in x:                     try:                if float(y):                    value = float(y.strip())                    temp_list.append('%02g'%value)                except ValueError:                    print y                    if y == "US" or y == "INT":                        temp_list.append(y)                        lines [temp] = temp_list                    else:                        lines [temp] = temp_list                        temp = y    return linesfile = open ('airport_data.txt')print file_to_dictionary (file)