Many thanks for the replies.  getattr() works great:

>>> name='Moon'
>>> m2 = getattr(ephem,name)()
>>> m2.compute(home)
>>> print ephem.localtime(m2.rise_time)
2009-11-11 01:30:36.000002

shows the moon will rise at 1:30am localtime tonight at my home location.

Excellent.

-- 
NickC
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to