CL und Skript geben verschiedenen Output
Verfasst: Sonntag 8. August 2010, 12:37
Hallo zusammen
Folgendes Script sollte die Anzahl verfügbarer Screens ausgeben, was es in der ersten Zeile auch tut, dann kommt sehr viel zusätzliche Zeug:
Wenn ich das direkt in der CL ausführe, sieht das etwas anders aus:
Woran kann das liegen?
Besten Dank für Postings
Folgendes Script sollte die Anzahl verfügbarer Screens ausgeben, was es in der ersten Zeile auch tut, dann kommt sehr viel zusätzliche Zeug:
Code: Alles auswählen
import sys
from PyQt4.QtGui import *
app = QApplication(sys.argv)
print QDesktopWidget.numScreens(QDesktopWidget())
mzh @ ~/qtgui_test/chap4 $ python screenNums.py
1
2010-08-08 13:34:57.635 Python[21540:613] *** _NSAutoreleaseNoPool(): Object 0x157289f0 of class NSView autoreleased with no pool in place - just leaking
Stack: (0x941daf4f 0x940e7432 0x916ed696 0x916e33d1 0x916ecf86 0x91766695 0x902fc676 0x916f9adc 0x916f97e8 0x9176665f 0x91764fbd 0x1858e55 0x23bcf7a 0x18b74f3 0x13dcff2 0x13e180e 0x13e1870 0x11bb0c 0x12161c 0x2477ef 0x2284c9 0x228995 0x22cb69 0x2ad934 0x2bd963 0x2cf414)
2010-08-08 13:34:57.636 Python[21540:613] *** _NSAutoreleaseNoPool(): Object 0x157289f0 of class NSView autoreleased with no pool in place - just leaking
Stack: (0x941daf4f 0x940e7432 0x902fc676 0x916f9b54 0x916f97e8 0x9176665f 0x91764fbd 0x1858e55 0x23bcf7a 0x18b74f3 0x13dcff2 0x13e180e 0x13e1870 0x11bb0c 0x12161c 0x2477ef 0x2284c9 0x228995 0x22cb69 0x2ad934 0x2bd963 0x2cf414)
Code: Alles auswählen
mzh @ ~/qtgui_test/chap4 $ python
Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt4.QtGui import *
>>> from PyQt4.QtCore import *
>>> import sys
>>> app = QApplication(sys.argv)
>>> app
<PyQt4.QtGui.QApplication object at 0xcad68>
>>> QDesktopWidget
<class 'PyQt4.QtGui.QDesktopWidget'>
>>> QDesktopWidget.numScreens
<built-in function numScreens>
>>> a = QDesktopWidget()
>>> a
<PyQt4.QtGui.QDesktopWidget object at 0xcaf60>
>>> QDesktopWidget.numScreens(a)
1
>>> quit()
Besten Dank für Postings