The runtime command to open it is TextureViewWindow, so I guess you could do something like...
import maya.cmds as cmds
cmds.TextureViewWindow()
Thank you! As i noticed the mel command of UV is:
TextureViewWindow
and Python just added those lines:
import maya.cmds as cmds cmds.
So to "convert" any of standart editors (no only) to Python i have to add those lines?
Yes, if you want to call a Maya Command then you can import maya.cmds and call one of the commands like we have there. The other common thing you'll probably end up doing at some point is wanting to call a MEL procedure, and for that you would do something like...
import maya.mel as mel
mel.eval('someMelProcedure()')
If you're trying to put together a script by looking at what you see in the Script Editor then might see a mix of commands and mel procedures. To know what everything is you can use "whatIs". e.g. in the script editor you can run...
mel.eval('whatIs "TextureViewWindow"')
# Result: Run Time Command #
mel.eval('whatIs "toggleUIComponentVisibility"')
# Result: Mel procedure found in: D:/Program Files/Autodesk/Maya2020/scripts/startup/UIComponents.mel #
So to call TextureViewWindow from Python you know you'll need to use maya.cmds, but if you wanted to call toggleUIComponentVisibility then you'd have to execute mel by using mel.eval.
Hope that helps