/+junk/pygooglechart-py3k

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/pygooglechart-py3k

« back to all changes in this revision

Viewing changes to examples/mapchart.py

  • Committer: Gustav Hartvigsson
  • Date: 2011-01-03 20:24:45 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20110103202445-qh7ogio9ined8ufv
Made it compatible with Python 3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    # Load the data from a file, create a dict that looks like:
36
36
    # {'AU': 5, 'YE': 10}
37
37
    data = {}
38
 
    countries = open('mapchart-birth-rate.txt', 'rb').read().split('\n')
 
38
    countriesRead = str(open('mapchart-birth-rate.txt', 'rb'))
 
39
    countries = countriesRead.split("\n")
39
40
    for line in countries[:-1]:
40
41
        code, score = line.split(' ', 1)
41
42
        data[code] = float(score)
 
43
        print("I ran")
42
44
 
43
45
    # Set the data dictionary for country codes to value mapping
44
46
    chart.add_data_dict(data)