mein hallo-welt-programm in python3 und PyQt will nicht gelingen:
Code: Alles auswählen
import sys
from PyQt5 import QtWidgets, QtGui, QtOpenGL
import OpenGL
from OpenGL.GL import *
#from OpenGL.GLU import *
import OpenGL.GL as gl
gl.glClearColor(0.0, 0.0, 0.0, 0.0)
gl.glMatrixMode(gl.GL_PROJECTION)
gl.glLoadIdentity()
gl.glOrtho(0.0, 1, 0.0, 1.0, -1.0, 1.0)
gl.glClear(GL_COLOR_BUFFER_BIT)
gl.glColor3f(1.0, 1.0, 1.0)
gl.glBegin(GL_LINES)
gl.glVertex2f(-1.0, -1.0)
gl.glVertex2f(0.0, 0.0)
gl.glEnd()
gl.glFlush()
app = QtWidgets.QApplication(sys.argv)
w = QtOpenGL.QGLWidget()
w.show()
app.exec()