From 332110f4494dec33df9265167c0b69051f080bba Mon Sep 17 00:00:00 2001 From: "Gergely Polonkai (W00d5t0ck)" Date: Wed, 9 Oct 2013 00:06:51 +0200 Subject: [PATCH] Make python example a bit more featureful Other languages will follow soon --- examples/basic.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/examples/basic.py b/examples/basic.py index fe1638e..414a219 100644 --- a/examples/basic.py +++ b/examples/basic.py @@ -11,5 +11,20 @@ moment.set_coordinates(19.03990999, 47.49801000, 280) moment.set_house_system(SweGlib.HouseSystem.PLACIDUS) moment.add_all_planets() -planet = moment.get_planet(SweGlib.Planet.SUN) -print planet.get_position() +all_planets = moment.get_all_planets() +for planet in all_planets: + print "%s: %f" % (planet.get_planet_info().get_name(), planet.get_position()) + +all_aspects = moment.get_all_aspects() +for aspect in all_aspects: + if aspect.get_aspect() != SweGlib.Aspect.NONE: + planet1 = aspect.get_planet1() + planet2 = aspect.get_planet2() + print "%s in %s with %s" % (planet1.get_planet_info().get_name(), aspect.get_aspect_info().get_name(), planet2.get_planet_info().get_name()) + +all_antiscia = moment.get_all_antiscia() +for antiscion in all_antiscia: + if antiscion.get_axis() != SweGlib.AntiscionAxis.NONE: + planet1 = antiscion.get_planet1() + planet2 = antiscion.get_planet2() + print "%s is antiscion of %s on axis %s" % (planet1.get_planet_info().get_name(), planet2.get_planet_info().get_name(), antiscion.get_antiscion_axis_info().get_name())