6

I'm trying to profile an application written using PySide and OpenCV and am getting strange behaviour with the profiler. I run my code using the following line:

python -m cProfile -o output.file repo/src/application_window.py

It tends to work for very short runs of the program. If I open it and load an image (it's an animation editor), output.file appears as expected. However, if I actually use the program (move through animation frames, etc.) there is no output. It generates no error messages or crash information - just nothing. The same problem occurs if I try to write the results to the console - sometimes it just produces no output.

Any thoughts on what could be causing this?

Edit: The call terminates as expected - but produces no output. It doesn't hang.

Edit2 - Here is the main function of application_window.py:

def main():
    a = QtGui.QApplication(sys.argv)
    editor = Editor(sys.argv[0])
    editor.show()

    sys.exit(a.exec_())

if __name__ == "__main__":
    main()

Editor is a fairly complicated QT Widget. So all application_window really does is start the QT event loop.

Catskul
  • 17,916
  • 15
  • 84
  • 113
The Bearded Templar
  • 671
  • 1
  • 7
  • 16

0 Answers0