Hello,
In python you have a wonderful function called dir() this function gives you the method that are accessible from the object given as argument. So if you try to print dir(my_attribute) that will give you all the function that you can use (like get_string(), get_double()...). That will help you in the future to find the right function to do what you want to.
To get the shading variable value of an attr (for example color) do like this:
python code
constant_color = ix.get_item("project://constant_color")
color_attr = constant_color.get_attribute("color")
if color_attr.is_shading_variable_activated(): # Check if the shading variable is activated on this attribute
print color_attr.get_bound_shading_variable() # Get the content of the shading variable
If you need more information, feel free to ask.
Regards