class Game(): # ustawienia ekranu i gry pygame.display.set_caption('Dedal Maze') screen = pygame.display.set_mode(gm.SIZESCREEN, pygame.FULLSCREEN) screen.blit(gm.BACKGROUND, (0, 0)) clock = pygame.time.Clock() # centrowanie okna os.environ['SDL_VIDEO_CENTERED'] = '1' pygame.init() # konkretyzacja obiektów player = player.Player(gm.STAND_D) plate = plates.Plates(gm.BLACK, gm.SCALE, gm.ROAD) # głowna pętla gry window_open = True while window_open: # pętla zdarzeń for event in pygame.event.get(): if event.type == pygame.KEYDOWN: if event.key == pygame.K_ESCAPE: window_open = False elif event.type == pygame.QUIT: window_open = False # rysowanie i aktualizacja obiektów plate.draw(screen) player.draw(screen) # aktualizacja okna pygame pygame.display.flip() clock.tick(30) pygame.quit()
def make_app(): dealerFolder = "csv" dealer_plates = plates.Plates(dealerFolder) return tornado.web.Application([ (r"/", MainHandler), (r"/robots.txt", RobotsHandler), (r"/search", SearchHandler, dict(dealer_plates = dealer_plates)), (r"/list", ListHandler, dict(dealer_plates = dealer_plates)), ])
def make_app(): dealerFolder = "csv" dealer_plates = plates.Plates(dealerFolder) return tornado.web.Application([ (r"/", MainHandler), (r"/index.html", MainHandler), (r"/search", SearchHandler, dict(dealer_plates=dealer_plates)), (r"/list", ListHandler, dict(dealer_plates=dealer_plates)), (r"/css/(.*)", tornado.web.StaticFileHandler, { "path": "css/" }), (r"/images/(.*)", tornado.web.StaticFileHandler, { "path": "images/" }), ])
def make_app(): dealers = [("dealer1", True), ("dealer2", False)] dealer_plates = plates.Plates(dealers) return tornado.web.Application([ (r"/", MainHandler), (r"/index.html", MainHandler), (r"/wordpress.html", WPHandler), (r"/search", SearchHandler, dict(dealer_plates=dealer_plates)), (r"/list", ListHandler, dict(dealer_plates=dealer_plates)), (r"/css/(.*)", tornado.web.StaticFileHandler, { "path": "css/" }), (r"/images/(.*)", tornado.web.StaticFileHandler, { "path": "images/" }), ])
import plates allPlates = ["SYDNEY"] for p in allPlates: status, expires = plates.Plates(p) print(p, status, expires)