我想知道如何用 PyQt6 运行这个 python 脚本,实际代码显示窗口,当我关闭它时它运行第二个代码
点击按钮>>>> hops.start(debug=True)
import ghhops_server as hs
from PyQt6.QtWidgets import QApplication, QWidget, QLineEdit, QPushButton, QTextEdit, QVBoxLayout
from PyQt6.QtGui import QIcon
class MyApp(QWidget):
def __init__(self):
super().__init__()
# appl = QApplication([])
appl = QApplication(sys.argv)
window = MyApp()
window.show()
appl.exec()
hops = hs.Hops()
@hops.component(
"/pointat",
name="PointAt",
description="Get point along curve",
icon="examples/pointat.png",
inputs=[
hs.HopsCurve("Curve", "C", "Curve to evaluate"),
hs.HopsNumber("t", "t", "Parameter on Curve to evaluate"),
],
outputs=[
hs.HopsPoint("P", "P", "Point on curve at t")
]
)
def pointat(curve, t):
return curve.PointAt(t)
if __name__ == "__main__":
hops.start(debug=True)