Is there a more Pythonic way of defining this function?
def idsToElements(ids):
elements = []
for i in ids:
elements.append(doc.GetElement(i))
return elements
Maybe its possible with list comprehension. I am basically looking to take a list of ids and change them to a list of elements in something simpler than defining a function.
If a list comprehension is all that you wanted
def idsToElements(ids):
return [doc.GetElement(i) for i in ids ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With