Exemplo n.º 1
0
def start_gui():
	app = QApplication(argv)
	# noinspection PyArgumentList
	MainWindow = QMainWindow()
	ui = UI()
	ui.setupUi(MainWindow)
	MainWindow.show()
	exit(app.exec_())
Exemplo n.º 2
0
 def __init__(self, app, width, height, title):
     self.title = title
     self.width = width
     self.height = height
     self.UI = UI(app)
     self.app = app
     self.screen = None
     self.colors = {'black': (0, 0, 0)}
def main():
    continue_program = True

    m = menu()

    if m == 1:
        user_thread= True
    elif m == 2:
        user_thread = False
    else:
        continue_program = False

    if continue_program:
        if user_thread:
            print(f"{Fore.LIGHTMAGENTA_EX}[WARNING]{Style.RESET_ALL} Do not put a lot of threads or you will crash. 2 threads is decent. (chrome windows)")
            num_thread = int(input(f"{Fore.LIGHTMAGENTA_EX}[>]{Style.RESET_ALL} Enter number of threads [eg. 3] > "))
        
        proxies = gather_proxy()

        os.system('cls')
        UI.banner()
        print('\n\n')

        if user_thread:

            threads = []

            if len(proxies) != 0:
                os.system('title Discord Generator ^| Proxy: True ^| Threading: True')

                for i in range(num_thread):
                    t = threading.Thread(target=worker, args= (random.choice(proxies), ))
                    threads.append(t)
                    t.start()
            else:
                os.system('title Discord Generator ^| Proxy: False ^| Threading: True')

                for i in range(num_thread):
                    t = threading.Thread(target=worker)
                    threads.append(t)
                    t.start()
        else:
            if len(proxies) != 0:
                os.system('title Discord Generator ^| Proxy: True ^| Threading: False')
                worker(random.choice(proxies))

            else:
                os.system('title Discord Generator ^| Proxy: False ^| Threading: False')
                worker()    
Exemplo n.º 4
0
class Window():
    def __init__(self, app, width, height, title):
        self.title = title
        self.width = width
        self.height = height
        self.UI = UI(app)
        self.app = app
        self.screen = None
        self.colors = {'black': (0, 0, 0)}

    def init(self):
        """
        Init window and screen painter
        :return: None
        """
        pygame.init()
        self.screen = pygame.display.set_mode((self.width, self.height))
        pygame.display.set_caption(self.title)

    def display(self):
        """
        Display scnene, objects and ui
        :return: None
        """
        self.screen.fill(self.colors['black'])

        self._draw_scene_objects()
        self.UI.show()

        pygame.display.flip()

    def _draw_scene_objects(self):
        """
        Draw game objects for interaction
        :return: None
        """
        for name, object in self.app.game_objects.items():
            if name == 'plates':
                for plate in object:
                    plate.draw(self.screen)
            else:
                object.draw(self.screen)
def main():
    """
    @pre: none
    @post: initializes pygame and creates a UI object which runs the game
    """

    display = pygame.display.set_mode((1000, 100))
    pygame.display.set_caption('Play Minesweeper!')

    user = UI.UI(display)
    user.launch()
Exemplo n.º 6
0
def menu():
    proxies = gather_proxy()

    os.system('cls')

    if len(proxies) != 0:
        os.system('title Discord Generator ^|  ^| PROXY LIST DETECTED')

    else:
        os.system('title Discord Generator ^| :')
    UI.banner()
    UI.start_menu()

    try:
        user_input = int(
            input(f"\t\t{Fore.LIGHTMAGENTA_EX}[?]{Style.RESET_ALL} > "))
        print('\n\n')
    except ValueError:
        user_input = 0

    if user_input == 1:
        os.system('cls')
        UI.banner()
        UI.menu2()

        try:
            user_input = int(
                input(f"\t\t{Fore.LIGHTMAGENTA_EX}[?]{Style.RESET_ALL} > "))
            print('\n\n')
        except ValueError:
            user_input = 0

        if user_input == 1:
            return 2

        elif user_input == 2:
            return 1

        else:
            return None
Exemplo n.º 7
0
        continue_program = False

    if continue_program:
        if user_thread:
            print(
                f"{Fore.LIGHTMAGENTA_EX}[WARNING]{Style.RESET_ALL} Do not put a lot of threads or you will crash. 2 threads is decent. (chrome windows)"
            )
            num_thread = int(
                input(
                    f"{Fore.LIGHTMAGENTA_EX}[>]{Style.RESET_ALL} Enter number of threads [eg. 3] > "
                ))

        proxies = gather_proxy()

        os.system('cls')
        UI.banner()
        print('\n\n')

        if user_thread:

            threads = []

            if len(proxies) != 0:
                os.system(
                    'title Discord Generator ^| Proxy: True ^| Threading: True'
                )

                for i in range(num_thread):
                    t = threading.Thread(target=worker,
                                         args=(random.choice(proxies), ))
                    threads.append(t)
Exemplo n.º 8
0
pygame.mixer.music.load('sprite/music.mp3')

# arme
# epe
epe1 = pygame.image.load('sprite/sword.png')
epe2 = pygame.image.load('sprite/iron_sword.png')
epe3 = pygame.image.load('sprite/steel_sword.png')
epe4 = pygame.image.load('sprite/master_sword.png')
# arc
arc1 = pygame.image.load('sprite/Arc.png')
arc4 = pygame.image.load('sprite/arc_elfique.png')

pygame.display.set_icon(zombie)

police = pygame.font.Font('8bit.ttf', 20)
ui = UI.UI()


def isinrange(x, y, max_x, max_y):
    """
    :param x: position x visée
    :param y: position y visée
    :param max_x: taille du tableau x
    :param max_y: taille du tableau y
    :return: si on est dans le tableau ou pas
    """
    if x >= max_x or x < 0 or y >= max_y or y < 0:
        return False
    else:
        return True
Exemplo n.º 9
0
'''
Created on Jan 2, 2018

@author: Wolf
'''
from src.UI import *
from src.validator import *
from src.board import *
'''
boardplayer, boardcomputer, boardplayerTarget, boardcomputerTarget
'''
boardplayer = board()
boardcomputer = board()
boardplayerTarget = board()
boardcomputerTarget = board()
x = UI(boardplayer, boardcomputer, boardplayerTarget, boardcomputerTarget)
x.menu()
Exemplo n.º 10
0
from PyQt5 import QtWidgets
from PyQt5 import QtGui

from src import UI
from src.Config import config
from cfg import resource

if __name__ == "__main__":
    import sys

    app = QtWidgets.QApplication(sys.argv)
    font_id = QtGui.QFontDatabase.addApplicationFont(
        resource('Calibri-Regular.ttf'))
    font = QtGui.QFont(
        QtGui.QFontDatabase.applicationFontFamilies(font_id)[0],
        config["main_font_size"])
    app.setFont(font)
    app.setWindowIcon(QtGui.QIcon(resource("icon.ico")))
    MainWindow = UI.Ui_MainWindow(app)
    MainWindow.show()
    sys.exit(app.exec_())