Rotate Empty on Local X-Axis using Python Script
Your first attempt did not work because (as Ray Mairlot pointed out) the attribute is rotation_euler, not rotation.euler. Further more, with the proper notation it will only rotate the active object, not all objects selected. 

This five line script rotates all selected objects by 90° on the local X axis.

import bpy
from math import pi
for ob in bpy.context.selected_objects:
    ob.rotation_euler[0] = pi/2
    ob.convert_space(from_space='LOCAL', to_space='WORLD')


The from math import pi line is just so we can use pi/2 instead of 1.5708 as the value to rotate by.