diff 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
line wrap: on
line diff
--- a/pyikriam/example.py	Sat Nov 01 22:21:25 2008 +0800
+++ b/pyikriam/example.py	Sun Nov 02 00:12:53 2008 +0800
@@ -1,8 +1,19 @@
+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(117261)
+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
@@ -10,5 +21,5 @@
 print 'marble is ' + city.marble
 print 'crystal is ' + city.crystal
 print 'sulfur is ' + city.sulfur
+print 'positions ' + repr(city.positions)
 
-