ylthh Posted February 25, 2014 Share Posted February 25, 2014 Hello. I have a question about pyqt or pyside. I made a simple pyqt. I typed some scripts in Python source editor like... ############### import sys sys.path.append('Z:/Script') try: reload(simple_qt) except: import simple_qt ################ It is working very well in python source editor in houdini. However, when I made a button on houdini shelf, it is not working well. First when I press a button, a ui pops up. But there is no pop-up after the first press. Then I add one more line... ############### import sys sys.path.append('Z:/Script') try: reload(simple_qt) except: import simple_qt reload(simple_qt) ################ This is working, but you know, one more execution happens right away after one execution. I think It is not good for script. If anyone know about this, please help me. Thank you. Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted March 3, 2014 Share Posted March 3, 2014 I guess you have all your PyQt code in global name space of simple_qt file. This is not good. Make a function in simple_qt file. for example: def show_my_app(): app = QApplication() ui = MyDialog() ui.show() app._exec() Then in houdini: import simple_qt reload(simple_qt) simple_qt.show_my_app() And don't forget this Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.