Mercurial > eagle-eye
comparison pyikriam/example.py @ 170:7df753a99926
merged
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Sun, 02 Nov 2008 02:23:13 +0800 |
parents | 8f699a9da6c0 |
children | 3ba3edda6d1e |
comparison
equal
deleted
inserted
replaced
169:a60cf4d1a6dd | 170:7df753a99926 |
---|---|
1 from __init__ import Ikariam | 1 import sys |
2 from ikariam import Ikariam | |
3 | |
4 if len(sys.argv) != 2: | |
5 print >> sys.stderr, 'Usage: %s <city id>' % (sys.argv[0]) | |
6 sys.exit(1) | |
7 pass | |
8 | |
9 city_id = int(sys.argv[1]) # 117261 | |
2 | 10 |
3 i = Ikariam() | 11 i = Ikariam() |
4 city = i.city(117261) | 12 city = i.city(city_id) |
13 | |
14 print "pull datas of the city %s" % (city_id) | |
5 city.sync() | 15 city.sync() |
6 print 'gold is'+city.gold | 16 |
17 print 'gold is ' + city.gold | |
18 print 'inhabitants is ' + city.inhabitants | |
19 print 'wood is ' + city.wood | |
20 print 'wine is ' + city.wine | |
21 print 'marble is ' + city.marble | |
22 print 'crystal is ' + city.crystal | |
23 print 'sulfur is ' + city.sulfur | |
24 print 'positions ' + repr(city.positions) | |
25 | |
26 city.positions[0].sync() | |
27 print 'positions[0] level is ' + str(city.positions[0].level) |