There is alot of GUI packages for Python, but as far as I know the only one that "comes with python" is Tkinter. Here is a toy program that draws a funny shape
Code:
# basis for this stuff was found at this guys website : http://matt.wandel.ca/ #kudos@spray.no from Tkinter import * import math root = Tk() w = Canvas(root, width=300, height=300) theta = 0.015 sx = 358.690012296 sy = 452.337492999 w.create_rectangle(0,0,300,300,fill="#000000") while(theta<4*3.1415): xt = math.sin(theta * 10) * 270 + 300 yt = math.cos(theta * 9.5) * 270 + 300 nthet = xt / 30 + yt / 30 yp = yt + math.sin(nthet) * 20 xp = xt + math.cos(nthet) * 20 w.create_line(sx/2,sy/2,xp/2,yp/2,fill="#ffffff",width=2) sx = xp sy = yp theta+=0.004 w.pack() root.mainloop()
Comment