view pyikriam/example.py @ 172:ba03aa8abdb2

reading Tavern's infomration
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Sun, 02 Nov 2008 00:30:02 +0800
parents e49137521123
children f7fd2738b9b4
line wrap: on
line source

import sys
from __init__ import Ikariam

if len(sys.argv) != 2:
    print >> sys.stderr, 'Usage: %s <city id>' % (sys.argv[0])
    sys.exit(1)
    pass

city_id = int(sys.argv[1]) # 117261

i = Ikariam()
city = i.city(city_id)

print "pull datas of the city %s" % (city_id)
city.sync()

print 'gold is ' + city.gold
print 'inhabitants is ' + city.inhabitants
print 'wood is ' + city.wood
print 'wine is ' + city.wine
print 'marble is ' + city.marble
print 'crystal is ' + city.crystal
print 'sulfur is ' + city.sulfur
print 'positions ' + repr(city.positions)