Hi,
I have an application I am writing that has a fairly complicated set of functions that take a while to run.
I have put them inside a separate module file (and in their own class) to keep things simple.
the end of my main GUI file looks like this:
if __name__ == "__main__":
import sys
if len(sys.argv) == 1:
filePath = serverRoot + ''
else:
filePath = sys.argv[1]
chunks = os.path.split(filePath)
fpath = chunks[0]
fname = chunks[1]
panel = StartQT4(fpath, fname)
panel.show()
sys.exit(app.exec_())
if __name__ == "__main__":
import sys
app = QtGui.QApplication(sys.argv)
if len(sys.argv) == 1:
filePath = serverRoot + ''
else:
filePath = sys.argv[1]
chunks = os.path.split(filePath)
fpath = chunks[0]
fname = chunks[1]
panel = StartQT4(fpath, fname)
panel.show()
sys.exit(app.exec_())
To copy to clipboard, switch view to plain text mode
I'm guessing this is a very newb question, but I can't seem to figure out how to send a signal (so I can update the UI) from a class in a separate file.
Imagine the other file looks something like this:
#myLib.py
class Stuff:
def doComplicatedStuff():
# Somehow send a signal here back to the main app that called this function
#myLib.py
class Stuff:
def doComplicatedStuff():
# Somehow send a signal here back to the main app that called this function
To copy to clipboard, switch view to plain text mode
I am planning on running the "complicated function" in a separate thread so that the GUI updating will work.
Am I way off here?
This is only my 3rd day of Python, so please be gentle 
Thanks in advance.
Bookmarks