I can use the code below to switch the space type to the UV Editor, but i can’t figure out how to change the space type to be the compositor. The Node Editor space doesn’t have a mode property. Does any one know how to change the space to be the compositor with the bpy?
import bpy
area = bpy.context.area
area.type = 'IMAGE_EDITOR'
for space in area.spaces:
if space.type == 'IMAGE_EDITOR':
space.mode = 'UV'