OpenExoplanetCatalogue / open_exoplanet_catalogue

The main data repository for the Open Exoplanet Catalogue
http://openexoplanetcatalogue.com
987 stars 217 forks source link

Errors: How to access the catalogue using Python 3 #1115

Open JosephKarpinski opened 3 years ago

JosephKarpinski commented 3 years ago

Current Python 3 examples have errors because print statements now require parentheses. Please make the following corrections to the 'How to access the catalogue using Python' section:

Output mass and radius of all planets

for planet in oec.findall(".//planet"): print([planet.findtext("mass"), planet.findtext("radius")])

Find all circumbinary planets

for planet in oec.findall(".//binary/planet"): print(planet.findtext("name"))

Output distance to planetary system (in pc, if known) and number of planets in system

for system in oec.findall(".//system"): print(system.findtext("distance"), len(system.findall(".//planet")))

hannorein commented 3 years ago

Hi Joseph. Can you submit a pull request? Thanks!