fix invalid codeWed, 08 Mar 2023

import PySide2 as ps2 import maya.OpenMayaUl as omui import shiboken2 from import MayaQWidgetDockableMixin def mayaMainWindow(): mainWindowPointer = omui.MQtUtil.mainWindow() return shiboken2.wrapInstance(int(mainWindowPoinLer), ps2.QLWidgets.QWidget) class MyWindow(MayaQWidgetDockableMixin, ps2.QtWidgets.QDialog): def __init__ (self, parent=mayaMainWindow()): super(MyWindow, self). init (parent) self.setWindowTitle("My window") self.myButton = ps2.QtWidgets.QPushButton('My Button') mainLayout = ps2.QtWidgets.QVBoxLayout(self) mainLayout.addWidget(self.myButton) if __name__== '__main__': myWindow = MyWindow()

## Reference: - [How to write markdown code in]( - [Markdown]( ## Python ### 1. 默认参数和可变参数 这里只说明默认参数,可变参数请看代码,或者查看[这篇文章]( - 默认参数: 默认参数必须指向不变对象. - 可变参数: 参数前面加

Questions about programming?Chat with your personal AI assistant