def main(): # Initialize grid of zeros district_grid = initialize_district_grid(0) # Start with a list of contiguous coordinates, # so that there's at least 1 contiguous redistricting scheme coordinates = get_contiguous_coordinates() # Keep track of each contiguous redistricting scheme contiguous_coordinate_list = [] # Add another set of contiguous coordinates to list, # so that you don't have to wait so long to see results. contiguous_coordinate_list.append(get_second_contiguous_coordinates()) for i in range(NUM_REDISTRICTING_SCHEMES): redistrict_grid(district_grid, coordinates) if is_grid_contiguous(district_grid): contiguous_coordinate_list.append(coordinates[:]) shuffle(coordinates) print_loading_dots(i) # TODO: Give output printer a more descriptive name output_printer = OutputPrinter(contiguous_coordinate_list) output_printer.print_output() # Run GUI application gui = App(contiguous_coordinate_list, output_printer.winning_ratios) gui.run_mainloop()
def main(): try: obj = App() root = Tk() obj.run(root) except KeyboardInterrupt: print("Keyboard Interrupt Occured") sys.exit() except: traceback.print_exc() sys.exit()
def __init__(self, graph_list: nx.PlanarEmbedding): App.__init__(self, graph_list) self.window = Tk() self.window.title("Planar graph drawing on a grid") self.grid = None self.button = Button(self.window, text="Set window full screen and then click me", command=self.init_canvas) self.button.pack() self.window.mainloop()
def main(): x, y = read_processed_data() X_train, X_test, y_train, y_test = train_test_split(x, y, stratify=y, train_size=0.7, shuffle=True) # Create models dnn = train_dnn(X_train, y_train) bayes = train_bayes(X_train, y_train) logReg = train_logReg(X_train, y_train) # Compare and Evaluate models models = [dnn, bayes, logReg] best_model_index, best_score = compare_models(models, X_test, y_test) if (best_model_index == 0): print("The Best model was: DNN") elif (best_model_index == 1): print("The Best model was: Bayes") elif (best_model_index == 2): print("The Best model was: Regression") print("The Highest score was: {:.3f}".format(best_score)) # Start GUI. User input is taken and predicition is made print("Starting GUI...") root = Tk() App(root, models[best_model_index], best_model_index) root.mainloop() print("GUI Closed...")
def test_window(qtbot): app = App() app.create_window() app.init_threads() #qtbot.addWidget(app.window) assert app.window.isVisible() assert app.window.windowTitle() == "Warframe Prime Helper"
def entry(): """Application entry point.""" logging.basicConfig(filename="last.log", level=logging.INFO, format="%(asctime)-15s | %(levelname)s | %(message)s") logging.info("--- LOG START ---") win = QApplication(sys.argv) apply_style(win) App() code = win.exec_() logging.info("Program exit with code %d.", code) if code != 0: logging.warning( "Program exit code was not 0. This means something went wrong while executing the program." ) logging.info("--- LOG END ---") sys.exit(code)
The purpose of this game is to build intuition for gravitational forces in a fun way. The objective of the game is to manoeuvre a ship from one planet to another, using gravitational forces of planets inbetween. The following simplifications have been made: * The game universe is two-dimensional * Distances between planets are vastly reduced. * Planets have no atmosphere * Ships are launched vertically. Once launched, they can not be further controlled. * Ships are launched with infinite acceleration, ie. the user can determine the initial thrust and the ship will reach its maximum speed instantly. * Ships land with infinite (negative) acceleration, ie. we are not concerned with "soft" landings (assuming fantastic airbag technology :) """ from gui import App from config import Settings app = App(Settings()) app.run()
def main(): app = QApplication(sys.argv) ex = App() sys.exit(app.exec_())
# class handles keyboard input and reading of the text from tts import TTS # custom gui script for generating tkinter # windows containing play and quit buttons from gui import App import sys # added to fix a anonying error with pyinstaller #EX: "[123972] Failed to execute script pyi_rth_win32comgenpy" app = App() tts = TTS() print("Ultimate tts reader:") print("press escape to quit program <ESC>") # external loop not part of tkinker thread # loop exits when the tkinter windows is closed while app.is_alive(): # time.sleep(1) # print(app.is_alive()) tts.iterate() sys.exit() tts.endloop()
#################################################### # You may only change the initial board here # # Any change other than board may result in crash # #################################################### from gui import App from PyQt5.QtWidgets import QApplication import sys import chess if __name__ == '__main__': app = QApplication(sys.argv) board = chess.Board( "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" ) #initial board is created here ex = App(board) app.exec_()
def main(): load_example_data() App.new(theme_repo, website_repo, monitoring_repo).draw()
def main(): app = QtWidgets.QApplication(sys.argv) window = App() window.show() app.exec_()
from gui import App if __name__ == '__main__': app = App() app.run()
root.title('PWman') def showAbout(): top = Toplevel() top.title('About PWman') About( top ) return root.createcommand('tkAboutDialog', showAbout) menubar = Menu(root) root.config(menu=menubar) app = App( root ) root.createcommand('exit', app.Quit) #make my screen dimensions work w = 320 h = 600 # get screen width and height ws = root.winfo_screenwidth() hs = root.winfo_screenheight() x = (ws/2) - (w/2) y = (hs/2) - (h/2) root.geometry('+%d+%d' % (x, y))
import sys from PyQt5.QtWidgets import QApplication from gui import App if __name__ == '__main__': app = QApplication(sys.argv) ex = App() sys.exit(app.exec_())
from gui import App # matoukla/py_sem_2018 # basic image edits © # main file runs the class App from GUI file # gui module contains filters and load modules #================================== a = App() #==================================
if __name__ == "__main__": from gui import App app = App() app.mainloop()
def runInteractive(self): # Create and run GUI App(sys.argv) # exec_'s itself return
# -*- coding: utf-8 -*- """ Created on Wed May 13 22:04:12 2020 @author: nguye """ from gui import App root = Tk() app = App(root) root.mainloop()
from gui import App, Vector #import read_stl #Initialize App app = App(width=1000, height=700, x_axis_scale=200, y_axis_scale=200, zoom=100, drag_scale=1) #Triangle XY v1 = Vector([0,0,0],[1,0,0]) v2 = Vector([0,0,0],[0,1,0]) v3 = Vector([0,1,0],[1,0,0]) #Square XY v4 = Vector([0,0,0],[0,0,1]) z5 = Vector([0,1,0],[0,1,1]) v6 = Vector([0,0,1],[0,1,1]) #Triangle XY v7 = Vector([0,0,1],[1,0,1]) v8 = Vector([0,0,1],[0,1,1]) v9 = Vector([0,1,1],[1,0,1]) #Close Square v10 = Vector([1,0,0],[1,0,1]) app.generateVectors() app.packObjects() app.modifyVectors() app.mainloop()
import sys from PyQt5.QtWidgets import QApplication from gui import App if __name__ == "__main__": app = QApplication(sys.argv) main = App() sys.exit(app.exec_())
from tkinter import * from objects import Character, Ground, Item from gui import App from threadingController import * app = App() app.gameMap.createGround(0, app.gameMap.width, app.gameMap.height, app.gameMap.height) # Create the ground app.gameMap.createGround(0, 150, app.gameMap.height - 100, app.gameMap.height - 100) # Create the ground app.gameMap.createGround(150, 300, app.gameMap.height - 200, app.gameMap.height - 200) # Create the ground app.gameMap.createGround(300, 450, app.gameMap.height - 300, app.gameMap.height - 300) # Create the ground app.gameMap.createGround(450, 600, app.gameMap.height - 400, app.gameMap.height - 400) # Create the ground mainCharacter = Character(type="Character", name="myCharacter", x=50, y=500, mapObject=app.gameMap, objectAnimationDir="character_1/", standard_vel_x=6) app.controlledObject = mainCharacter createObjectInGame(mainCharacter, app.gameMap) monster1 = Character(type="Monster", name="monster1", x=500, y=500,
from gui import App if __name__ == "__main__": app = App()
import tkinter as tk from binomial_heap import BinomialHeap from gui import App root = tk.Tk() root.title('Heap') App(root) root.mainloop()
from gui import App import pygame if __name__ == "__main__": pygame.init() app = App() app.start()
def main(): app = App() app.auswahl_select(app.auswahl) app.mainloop()
from gui import App if __name__ == "__main__": app = App(0) app.MainLoop()