Skip to content

Commit 0fde710

Browse files
authored
Merge pull request #8 from einarf/pep8-run
Pep8 run
2 parents fb3dd0b + 150283a commit 0fde710

File tree

4 files changed

+219
-219
lines changed

4 files changed

+219
-219
lines changed

demo.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,46 @@
66
"""
77

88
import sys, math, time
9-
if sys.version_info[0] < 3 :
9+
if sys.version_info[0] < 3:
1010
from Tkinter import Tk, YES, BOTH
1111
else:
1212
from tkinter import Tk, YES, BOTH
1313
from OpenGL import GL, GLU
1414
from pyopengltk import OpenGLFrame
1515

16+
1617
class AppOgl(OpenGLFrame):
1718

1819
def initgl(self):
19-
GL.glViewport( 0, 0, self.width, self.height)
20-
GL.glClearColor(1.0,1.0,1.0,0.0)
21-
GL.glColor3f(0.0,0.0, 0.0)
20+
GL.glViewport(0, 0, self.width, self.height)
21+
GL.glClearColor(1.0, 1.0, 1.0, 0.0)
22+
GL.glColor3f(0.0, 0.0, 0.0)
2223
GL.glPointSize(4.0)
2324
GL.glMatrixMode(GL.GL_PROJECTION)
2425
GL.glLoadIdentity()
25-
GLU.gluOrtho2D(-5,5,-5,5)
26+
GLU.gluOrtho2D(-5, 5, -5, 5)
2627
self.start = time.time()
2728
self.nframes = 0
28-
2929

3030
def redraw(self):
3131
GL.glClear(GL.GL_COLOR_BUFFER_BIT)
3232
GL.glBegin(GL.GL_POINTS)
3333
npt = 100
3434
for i in range(npt):
35-
x = -5.0 + i*10.0/npt
36-
y = math.sin(x+ time.time())*5/2
37-
GL.glVertex2f( x, y )
35+
x = -5.0 + i * 10.0 / npt
36+
y = math.sin(x + time.time())*5/2
37+
GL.glVertex2f(x, y)
3838
GL.glEnd()
3939
GL.glFlush()
40-
self.nframes+=1
40+
self.nframes += 1
4141
tm = time.time() - self.start
42-
print("fps",self.nframes / tm, end="\r" )
42+
print("fps", self.nframes / tm, end="\r")
43+
4344

4445
if __name__ == '__main__':
4546
root = Tk()
4647
app = AppOgl(root, width=320, height=200)
4748
app.pack(fill=BOTH, expand=YES)
48-
app.animate=1
49+
app.animate = 1
4950
app.after(100, app.printContext)
5051
app.mainloop()

0 commit comments

Comments
 (0)