/+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: Gerald Kaszuba
  • Date: 2010-12-24 05:18:55 UTC
  • Revision ID: git-v1:1a633e0584a557e812fae20deceaef514a515f62
gitignore compiled py files and setup.py build dir

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
 
    countriesRead = str(open('mapchart-birth-rate.txt', 'rb'))
39
 
    countries = countriesRead.split("\n")
 
38
    countries = open('mapchart-birth-rate.txt', 'rb').read().split('\n')
40
39
    for line in countries[:-1]:
41
40
        code, score = line.split(' ', 1)
42
41
        data[code] = float(score)
43
 
        print("I ran")
44
42
 
45
43
    # Set the data dictionary for country codes to value mapping
46
44
    chart.add_data_dict(data)