Exporting rotations of selected objects to a text file
You already outlined everything that needs to be done. Rotation can be reached at .rotation_euler:



Note that you can find this information by typing stuff to the console and hitting ctrl+space for auto complete.

The values are in radians so you need an easy way to convert them. You can just multiply the values by 57.29577951308232, or you could do from math import degrees or from math import degrees, radians so you have functions that can convert between the two for you. 

Everything from math is imported in the console so you could just get the degrees of x rotation of the active object by typing degrees(bpy.context.object.rotation_euler.x) in the console to check that this indeed does work. 

In a script this would look something like:

import bpy
from math import degrees

result = ''

for o in bpy.context.selected_objects:
    #something else that you need to get to result
    n = o.name
    r = o.rotation_euler
    result += "%s - X:%.3f, Y:%.3f, Z:%.3f \n" % (n, degrees(r.x), degrees(r.y), degrees(r.z))
    # carry on to do whatever else
#write to file