import maya.cmds as cmds
a = cmds.getAttr('defaultResolution.width')
print a
import maya.OpenMayaRender as omr
data = omr.MCommonRenderSettingsData()
omr.MRenderUtil.getCommonRenderSettings(data)
print data.width, data.height
import maya.cmds as cmds
a = cmds.getAttr('defaultResolution.width')
print a
import maya.OpenMayaRender as omr
data = omr.MCommonRenderSettingsData()
omr.MRenderUtil.getCommonRenderSettings(data)
print data.width, data.height