comparison pyikriam/example.py @ 162:e49137521123

pyikriam retrive information about land positions. - It retrive type of building on positions.
author Thinker K.F. Li <thinker@branda.to>
date Sun, 02 Nov 2008 00:12:53 +0800
parents 1507c2d16b35
children f7fd2738b9b4
comparison
equal deleted inserted replaced
161:1507c2d16b35 162:e49137521123
1 import sys
1 from __init__ import Ikariam 2 from __init__ import Ikariam
2 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
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()
16
6 print 'gold is ' + city.gold 17 print 'gold is ' + city.gold
7 print 'inhabitants is ' + city.inhabitants 18 print 'inhabitants is ' + city.inhabitants
8 print 'wood is ' + city.wood 19 print 'wood is ' + city.wood
9 print 'wine is ' + city.wine 20 print 'wine is ' + city.wine
10 print 'marble is ' + city.marble 21 print 'marble is ' + city.marble
11 print 'crystal is ' + city.crystal 22 print 'crystal is ' + city.crystal
12 print 'sulfur is ' + city.sulfur 23 print 'sulfur is ' + city.sulfur
24 print 'positions ' + repr(city.positions)
13 25
14