Revision 11 PyOpenGL-Demo/redbook/lines.py

lines.py (revision 11)
2 2

  
3 3
# This is statement is required by the build system to query build info
4 4
if __name__ == '__build__':
5
	raise Exception
5
	raise(Exception)
6 6

  
7 7
'''
8 8
lines.c from the Redbook examples.  
......
60 60
  from OpenGL.GL import *
61 61
  from OpenGL.GLU import *
62 62
except:
63
  print '''
63
  print('''
64 64
ERROR: PyOpenGL not installed properly.  
65
        '''
65
        ''')
66 66
  sys.exit()
67 67

  
68 68
def drawOneLine(x1, y1, x2, y2):
......
129 129
  gluOrtho2D(0.0, w, 0.0, h)
130 130

  
131 131
def keyboard(key, x, y):
132
  if key == chr(27):
132
  if key == str.encode(chr(27)):
133 133
    sys.exit(0)
134 134

  
135 135
glutInit(sys.argv)
136 136
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB)
137 137
glutInitWindowSize(400, 150)
138 138
glutInitWindowPosition(100, 100)
139
glutCreateWindow('Lines')
139
glutCreateWindow(b'Lines')
140 140
init()
141 141
glutDisplayFunc(display)
142 142
glutReshapeFunc(reshape)

Also available in: Unified diff