Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from classes.class_program import logic
- import pygame
- from pygame.locals import *
- import sys
- import time
- logic = logic()
- pygame.init()
- main_window = pygame.display.set_mode((300,600))
- pygame.display.set_caption('Xbox Alert')
- font_object = pygame.font.SysFont('Times New Roman', 32)
- msg = 'gamertag here'
- connected = []
- running = True
- while running == True:
- main_window.fill((0,0,0))
- for event in pygame.event.get():
- if event.type == pygame.QUIT:
- running = False
- pygame.quit()
- try:
- checker = logic.online_check()
- if checker == True:
- connected.append(True)
- else:
- connected.append(False)
- print connected
- alert = logic.online_alert(connected)
- if connected[-1] == True:
- connect_color = (0, 255, 0)
- else:
- connect_color = (255, 0, 0)
- except:
- connect_color = (255, 0, 0)
- continue
- msg_surface_object = font_object.render(msg, False, connect_color)
- msg_rect_object = msg_surface_object.get_rect()
- msg_rect_object.topleft = (10,20)
- main_window.blit(msg_surface_object, msg_rect_object)
- pygame.display.update()
- time.sleep(20)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement