Import Sys
Import Pygame
From pygame.locals Import *
Import time
Pygame.init ()
Screen=pygame.display.set_mode ((500,550))
Myfont=pygame.font.font (none,30)
Red= (255,0,0)
Green= (0,255,0)
Textimage=myfont.render (Time.strftime ("%y-%m-%d%h:%m:%s", Time.localtime ()), true,red)
Myclock=time.clock ()
While True:
For MyEvent in Pygame.event.get ():
If Myevent.type in (Quit,keydown):
Sys.exit ()
Myclock=time.clock ()
If myclock>5:
Textimage=myfont.render (Time.strftime ("%y-%m-%d%h:%m:%s", Time.localtime ()), true,red)
Screen.fill (Green)
Screen.blit (Textimage, (90,90))
Pygame.display.update ()
Import Sys
Import Pygame
From pygame.locals Import *
Import time
Pygame.init ()
Screen=pygame.display.set_mode ((500,550))
Myfont=pygame.font.font (none,30)
Red= (255,0,0)
Green= (0,255,0)
Blue= (0,0,255)
radius=10
Screen.fill (Green)
Pygame.draw.circle (screen,red, (200,250), radius,2)
Pygame.display.update ()
While True:
For MyEvent in Pygame.event.get ():
If Myevent.type in (Quit,keydown):
Sys.exit ()
radius+=10
Radius=radius% 200
Print radius
Pygame.draw.circle (screen,red, (200,250), radius,2)
Pygame.draw.rect (Screen,blue, (int (RADIUS/2), int (RADIUS/2), Radius,radius), 0)
Pygame.display.update ()
Time.sleep (10)
Python Notes (52)