Skip to content

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

@JosephKarpinski

Description

@JosephKarpinski

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")))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions