def __init__(self): # init pygame and set screen self.pygame = pygame self.pygame.init() self.pygame.display.set_caption('Ball Game') self.screenSize = self.width, self.height = 1200, 850 self.screen = pygame.Surface(self.screenSize) self.display = self.pygame.display.set_mode(self.screenSize) # Defining variables self.highScore = 0 self.level = 1 self.score = 0 self.shake = 0 self.paused = False self.startNewLevel = False # Autopilot self.auto = False # Initialize animations Ball.setFrames() BombCrate.setFrames() self.background = Background() # Initialize UI class self.ui = UI(self) # Set up game clock self.clock = pygame.time.Clock() # finish setting up game setUp(1, self)
def run(): repo = ContactRepository() repo.addContact(Contact("Popescu", "+40-711-111999", "work")) repo.addContact(Contact("Mom", "+40-733-333444", "personal")) repo.addContact(Contact("Dana", "+40-744-444999", "personal")) controller = ContactController(repo) ui = UI(controller) ui.run()
def main(): """ Main method :return: None """ ui = UI() ui.change_panel(MainMenuPanel) ui.mainloop()
def start(): repo = VectorRepository() repo.addVector(MyVector("abc", "r", 1, [1, 2, 3, 4])) repo.addVector(MyVector("aaa", "g", 3, [2, 2, 3, 4, 7, 8])) repo.addVector(MyVector("test", "b", 3, [4, 5])) repo.addVector(MyVector("1", 'r', 2, [10, 3, 9])) repo.addVector(MyVector("2", 'y', 4, [1, 3, 6, 9])) controller = VectorController(repo) ui = UI(controller) ui.run()
def __init__(self): # repositories self.repo_clients, self.repo_movies, self.repo_rentals = self.read_properties_file() # services self.services_clients = ServicesClients(self.repo_clients) self.services_movies = ServicesMovies(self.repo_movies) self.services_rentals = ServicesRentals(self.repo_rentals) # ui self.ui = UI(self.services_clients, self.services_movies, self.services_rentals) self.repository_type = None # loads data to persistent reposoitory when user exits application atexit.register(self.write_data_to_persistent_repository)
from Repository.Repoitory import * from Service.Service import * from Service.Service_Taxe import * from UI.UI import UI repo_client = Repository_Generic('Clienti') repo_taxe = Repository_Generic('Taxe') serv_client = Service_Client(repo_client) serv_taxe = Service_Taxe(repo_taxe) console = UI(serv_client, serv_taxe) console.console()
def __init__(self, args): args.append("--disable-web-security") self.app = QApplication(args) self.ui = UI()
from PyQt5.QtWidgets import * from UI.UI import UI import sys # main function if __name__ == '__main__': app = QApplication(sys.argv) ex = UI() sys.exit(app.exec_())
from Board.Board import Board from Game.Game import Game from UI.UI import UI board = Board() game = Game(board) ui = UI(game, board) ui.startUI()
from Infastructure.PlantRepository import PlantRepository from UI.UI import UI from Domain.Plant import Plant repo = PlantRepository() repo.add_plant(Plant("abc", 1, 2)) repo.add_plant(Plant("bcd", 10, 0)) repo.add_plant(Plant("basda", 20, 30)) repo.add_plant(Plant("ddd", 10, 15)) repo.add_plant(Plant("abcdef", 3, 0)) ui = UI(repo) ui.run()
''' Created on 19 dec. 2017 @author: Catalin ''' from op.controller import controller from repo.repo import busRepo, routeRepo from UI.UI import UI from domain.entities import route, bus rRepo = routeRepo() bRepo = busRepo() rRepo.add(route(1, 20)) rRepo.add(route(2, 20)) rRepo.add(route(3, 20)) rRepo.add(route(4, 20)) bRepo.add(bus(1, 2, "Merc", 5)) bRepo.add(bus(2, 3, "Volv", 6)) ctr = controller(rRepo, bRepo) ui = UI(ctr) ui.main()
from tkinter import Tk from fileio.fileio import File_reader from solver.solver import Route from UI.UI import UI if __name__ == "__main__": INPUT_FILE = "data/data.txt" reader = File_reader(INPUT_FILE) cities = reader.read_file() route = Route(cities) window = Tk() window.title("TSP solver") ui = UI(window, route) ui.start() window.mainloop()
from Repository.repository_generic import * from Service.service_tranzactie import Service_Tranzactie from Service.service_card import Service_Card from Service.service_medicament import Service_Medicament from UI.UI import UI repo_medicament = Repository_generic('MEDICAMENT') repo_tranzactie = Repository_generic('TRANZACTIE') repo_card = Repository_generic('CARDURI') serv_medicament = Service_Medicament(repo_medicament) serv_tranzactie = Service_Tranzactie(repo_tranzactie, repo_medicament, repo_card) serv_card = Service_Card(repo_card) console = UI(serv_medicament, serv_card, serv_tranzactie) console.run_console()
from Repository.file_repository import rent_file from Validators import * from UI.UI import UI movie_repository = movie_repository.movie_repository() movie_validator = movie_validator.movie_validator() client_repository = client_repository.client_repository() client_validator = client_validator.client_validator() rent_repository = rent_repository.rent_repository() rent_validator = rent_validator.rent_validator() clients_file = client_file("clients.txt", client_repository) movies_file = movie_file("movies.txt", movie_repository) rents_file = rent_file("rents.txt", rent_repository) client_l = clients_file.loadFromFile() movie_l = movies_file.loadFromFile() rent_l = rents_file.loadFromFile() movie_controller = movie_controller.movie_controller(movie_repository, movie_validator) client_controller = client_controller.client_controller( client_repository, client_validator) rent_controller = rent_controller.rent_controller(rent_repository, rent_validator, movie_repository, client_repository) ui = UI(client_controller, movie_controller, rent_controller, clients_file, movies_file, rents_file) ui.main()
grade_validator, undo_service) # we add random data if we use the inmemory storing method if repoSetUp.get_mode == "inmemory": number = generateRandom(student_service, assignment_service, grade_service) number.generate_random_student() number.generate_random_assignment() number.generate_random_grades() if repoSetUp.get_uimode == "gui": gui = GUI(student_service, assignment_service, grade_service, undo_service) gui.start() elif repoSetUp.get_uimode == "menu": ui = UI(student_service, assignment_service, grade_service, undo_service) ui.start() """ repository = inmemory students = "" assignments = "" grades = "" ui = "gui" repository = binaryfiles students = "TextFiles/students.bin" assignments = "TextFiles/assignments.bin" grades = "TextFiles/grades.bin" ui = "gui" repository = jsonfiles
from UI.UI import UI from controller.Controller import Controller ctrl = Controller() ui = UI(ctrl) ui.run()
import sys from Entities.Client import Client from PyInquirer import prompt from UI import menu_variation from UI.UI import UI client = Client() username = prompt(menu_variation.input_name)['value'] if client.is_exists(username): client.connect(username) else: if len(sys.argv) > 1 and sys.argv[1] == 'owner': client.add_owner(username) elif len(sys.argv) > 1 and sys.argv[1] == 'admin': client.add_admin(username) else: client.add_user(username) client.connect(username) ui = UI(username) ui.start()
from UI.UI import UI if __name__ == '__main__': UI()
Brepo = FileRepository('books.txt', Book.readBookFromLine, Book.writeBookToLine) Crepo = FileRepository('clients.txt', Client.readClientFromLine, Client.writeClientToLine) Rrepo = Repository() Rrepo.add(Rental(16675, 16, 67, date(2017, 11, 10), date(2017, 12, 11))) Rrepo.add(Rental(12675, 12, 67, date(2017, 11, 1), date(2017, 11, 11))) Rrepo.add(Rental(13115, 13, 11, date(2017, 11, 21), date(2017, 11, 11))) Rrepo.add(Rental(13678, 13, 67, date(2017, 11, 7), date(2017, 11, 20))) Rrepo.add(Rental(12622, 12, 62, date(2017, 11, 18), date(2017, 1, 11))) Rrepo.add(Rental(14675, 14, 67, date(2017, 11, 5), date(2017, 11, 24))) Rrepo.add(Rental(14637, 14, 63, date(2017, 11, 10), date(2017, 10, 11))) Rrepo.add(Rental(14671, 14, 67, date(2017, 11, 9), date(2017, 12, 11))) Rrepo.add(Rental(16652, 16, 65, date(2017, 11, 4), date(2017, 11, 16))) Rrepo.add(Rental(15661, 15, 66, date(2017, 11, 12), date(2017, 10, 30))) Rrepo.add(Rental(12629, 12, 62, date(2017, 11, 13), date(2017, 11, 25))) Rrepo.add(Rental(15695, 15, 69, date(2017, 11, 19), date(2017, 11, 24))) Rrepo.add(Rental(16770, 16, 77, date(2017, 11, 2), date(2017, 11, 24))) Ucontroller = UndoController() Bcontroller = BookController(Brepo, Ucontroller, Rrepo) Ccontroller = ClientController(Crepo, Ucontroller, Rrepo) Rcontroller = RentalController(Rrepo, Brepo, Crepo, Ucontroller) ui = UI(Bcontroller, Ccontroller, Rcontroller, Ucontroller) # ui.mainMenu() root = Tk() gui = GUI(root, Bcontroller, Ccontroller, Rcontroller, Ucontroller) root.mainloop()
# repoGrade.addGrade(Grade(9, 7, 3.79), repoStudent, repoDiscipline) # repoGrade.addGrade(Grade(4, 22, 5.88), repoStudent, repoDiscipline) # repoGrade.addGrade(Grade(10, 18, 9.59), repoStudent, repoDiscipline) # repoGrade.addGrade(Grade(5, 3, 1.63), repoStudent, repoDiscipline) # repoGrade.addGrade(Grade(2, 24, 4.64), repoStudent, repoDiscipline) # repoGrade.addGrade(Grade(2, 10, 4.97), repoStudent, repoDiscipline) ctrlUndo = UndoController() ctrlDiscipline = DisciplineController(repoDiscipline, repoGrade, repoStudent, ctrlUndo) ctrlStudent = StudentController(repoStudent, repoGrade, repoDiscipline, ctrlUndo) ctrlGrade = GradeController(repoGrade, repoDiscipline, repoStudent, ctrlUndo) ctrlStatistics = StatisticsController(repoStudent, repoDiscipline, repoGrade) ui = UI(ctrlDiscipline, ctrlStudent, ctrlGrade, ctrlStatistics, ctrlUndo) ui.MainMenu() if reads[0] == "textfiles": repoDiscipline.writeAlltoFile() repoStudent.writeAlltoFile() repoGrade.writeAlltoFile() if reads[0] == "binaryfiles": repoDiscipline.writeAlltoFile() repoStudent.writeAlltoFile() repoGrade.writeAlltoFile()
from UI.UI import UI from Game.Game import Game g = Game() ui = UI(g) ui.Start()
# @Time : 2019/11/3 22:08 # @Author : Just # @Email : [email protected] # @File : main.py import tkinter from UI.UI import UI from UI.Cmdexe import Cmdexe from Utiliy.Utiliy import Utiliy from config import Config import sys if __name__ == '__main__': print(len(sys.argv)) print(str(sys.argv)) if len(sys.argv) == 1: root = tkinter.Tk() root.title(Config.main_win_title) root.update_idletasks() root.withdraw() root.geometry('%dx%d+%d+%d' % (Utiliy.getMsize(root))) root.deiconify() root.update() UI(root).pack() root.mainloop() else: blcheckno = sys.argv[1] file_path = sys.argv[2] print("病理号为:"+blcheckno) print("玻片路径为:"+file_path) cmd = Cmdexe(blcheckno, file_path) cmd.tran()
def __init__(self): self.bus = EventBus() self.simulator = Simulator(self.bus) self.ui = UI(self.bus)