I read that an empty list as an argument for the QApplication should work (instead of sys.argv). However in my case it does work when running it in an interactive ipython shell, but executing it with ipython results in a segmentation fault. Any idea why that happens? What makes the difference?
This works:
[jhennrich@tp-arch qt_test]$ ipython2
Python 2.7.12 (default, Jun 28 2016, 08:31:05)
Type "copyright", "credits" or "license" for more information.
IPython 5.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: from PySide.QtCore import *
...: from PySide.QtGui import *
...:
...: app = QApplication([])
...:
/home/jhennrich/.gtkrc-2.0:38: error: scanner: unterminated string constant
In [2]:
(I also tried it with more code, the application shows a window and stuff)
When executed as a script it doesnt work:
segfault1.py:
from PySide.QtCore import *
from PySide.QtGui import *
app = QApplication([])
running it:
[jhennrich@tp-arch qt_test]$ ipython2 segfault1.py
Segmentation fault (core dumped)
[jhennrich@tp-arch qt_test]$ ipython2