py_get_attr function

Get an attribute of a Python object