#!/_env/bin/python # coding: utf-8 # Import Packages -> Modules import tkinter as tk # Import Project -> Modules from gui import Gui if __name__ == '__main__': root = tk.Tk() app = Gui(root) app.run() #app.update_data_base()
import sys from PyQt5.QtWidgets import QApplication, QMainWindow from gui import Gui ''' Question 1: Changer le titre de la fenetre ok! Question 2: Changer la taille minimale de la fenetre (1280x720) ok! Question 3: Ajouter un menu "fichier" avec 3 actions possible (ouvrir / enregistrer / quitter) ok! Question 4: Ajouter la description des actions dans la "statue bar" ok! Question 5: ajouter un systeme d'onglet ok ! Question 6: dans l'onglet 1, ajouter un bouton qui ouvre un "input file" pour demander le nom de l'utilisateur ok Question 7: dans l'onglet 1, ajouter un label pour afficher le nom de l'utilisateur ok Question 8: Changer l'arriere plan de l'onglet 1 avec une image de votre choix ok Question 9: dans l'onglet 2, ajouter un tableau a deux colonnes pour enregistrer les carateristiques de l'utilisateur (nom, prenom, date de naissance, sexe, taille, poids) ok Question 10: dans l'onglet 2, ajouter un bouton "enregistrer" qui enregistre dans un fichier les carateristiques dans un fichier json ''' if __name__ == '__main__': app = QApplication(sys.argv) ex = Gui() sys.exit(app.exec_())
from gui import Gui my_gui = Gui() my_gui.main
from gui import Gui from PIL import Image, ImageTk import tkinter if __name__ == '__main__': gui1 = Gui() #creates Gui object gui1.create_objects() #creates object's like buttons gui1.place_objects() #places created objects gui1.change_turtle_image() #sets turtle image gui1.start_gui() #runs application
from cmd import run from gui import Gui import tkinter as tk import logging from datetime import datetime logging.basicConfig(filename='myapp.log', level=logging.INFO) logging.info(str(datetime.now()) + ' Started') print("please enter command: ") command = input() if '--get' in command or '--view' in command: logging.info(str(datetime.now()) + ' Console mode running...') run(command) else: logging.info(str(datetime.now()) + ' GUI mode running...') root = tk.Tk() app = Gui(master=root) app.mainloop() logging.info(str(datetime.now()) + ' Finished')
def main(): Gui().initialise_application()
def execute(): toTranslate = pyperclip.paste() translated = GoogleTranslator(source='auto', target='pl').translate(toTranslate) current.clear() translateGui = Gui(toTranslate, translated) translateGui.root.mainloop()
def setUp(self): self.gui = Gui()
import os import time import ctypes from gui import Gui from api.main import Server PLATFORM = platform.system() print(PLATFORM) if __name__ == "__main__": ep1, ep2 = Pipe() status = Value('i', 0) # 0 disconnecting, 1 connecting print('Parent process {}.'.format(os.getpid())) guiApp = Gui(status, ep2) p = Process(target=guiApp.start) print('Child process will start.') p.start() apiApp = Server(status, ep1) apiApp.start(port=8123) guiApp.quit() print('gui stoping...') p.join() print('Child process end.')
def main(): gui = Gui() gui.info() gui.show()
def main(): maingui = Gui() #initialize the GUI instance maingui.errorarea.insert("0.0", "GUI initialized from main!\n") maingui.outputarea.insert( "0.0", "Sample Output: INSERT INTO xxx VALUES (1,2,3);\n") maingui.window.mainloop() #the mainloop
def display_new_item(): image_and_text.display_new_item() effect.trigger_effect(constant.LED_EFFECT_TARGET, constant.STOP_COMMAND) if __name__ == "__main__": # Initialization logging.basicConfig(level=logging.DEBUG) printer.Fake_printer.start() root = tk.Tk() root.attributes('-fullscreen', True) canvas = Gui(root, width=config.SCREEN["WIDTH"], height=config.SCREEN["HEIGHT"]) canvas.pack() image_and_text.load_file_list() image_and_text.display_file(canvas) # For new item event root.bind(constant.SHOW_NEW_ITEM_EVENT, new_item_event) # Gui elements creation canvas.create_left_button(root, get_older_item) canvas.create_right_button(root, get_newer_item) canvas.create_print_button(root, printer.print_item) # Threads definition
from windows_media_control.media_manager import MediaManager from gui import Gui from lyrics_finder import LyricsFinder from threading import Timer gui = Gui(15, 70, 'Lyrics Finder') lf = LyricsFinder() timer = None suspended = False def set_timer(*args): global timer if timer and timer.is_alive(): timer.cancel() timer = Timer(1.0, on_song_changed, args=args) timer.start() gui.set_text('searching...') def on_song_changed(session, args): if args.title: try: lyrics = lf.find_lyrics(args.title, args.artist) gui.set_text(lyrics) except: query = f'{args.title}{f" by {args.artist}" if args.artist else ""}' gui.set_message( 'Something went wrong. You can try to modify the query:', query)
def main(): root = Tk() agent = TreeThreadingAgent() interface = Gui(root, agent) root.mainloop()
logging.error("Uncaught exception", exc_info=(exc_type, exc_value, exc_traceback)) if __name__ == "__main__": logging.config.fileConfig('logging.conf') sys.excepthook = handle_exception config_file = 'config.json' if len(sys.argv) > 1: config_file = sys.argv[1] if not os.path.isfile(config_file): logging.error("Failed to find config file: %s", config_file) sys.exit(1) config = json.load(open(config_file, 'r')) gui = Gui(**config) gui.main() try: config = json.load(open(config_file, 'r')) logging.debug(json.dumps(config, indent=2)) except Exception as err: logging.debug(json.dumps(config, indent=2)) handle_error('no_credentials') logging.debug("Creating service...") sheet_api = create_service() logging.debug("Initializing version blacklist...") blacklist = init_version_blacklist()
def main(arg_list): """Parse the command line options and arguments specified in arg_list. Run either the command line user interface, the graphical user interface, or display the usage message. """ usage_message = ( "Usage:\n" "Show help: logsim.py -h\n" "Command line user interface: logsim.py -c <file path>\n" "Graphical user interface: logsim.py <file path> or logsim.py") try: options, arguments = getopt.getopt(arg_list, "hc:") except getopt.GetoptError: print("Error: invalid command line arguments\n") print(usage_message) sys.exit() # Initialise instances of the four inner simulator classes names = Names() devices = Devices(names) network = Network(names, devices) monitors = Monitors(names, devices, network) #device = Device(self.names.lookup([names])) #names = None #devices = None #network = None #monitors = None for option, path in options: if option == "-h": # print the usage message print(usage_message) sys.exit() elif option == "-c": # use the command line user interface scanner = Scanner(path, names) parser = Parser(names, devices, network, monitors, scanner) if parser.parse_network(): # Initialise an instance of the userint.UserInterface() class userint = UserInterface(names, devices, network, monitors) userint.command_interface() if not options: # no option given, use the graphical user interface app = ab.BaseApp(redirect=False) error = ErrorFrame() if len(arguments) == 0: # wrong number of arguments # Initialise an instance of the gui.Gui() class path = None #print('len(arguments) = 0 if statement is accessed') scanner = Scanner(path, names) parser = Parser(names, devices, network, monitors, scanner) gui = Gui("LogicSim", path, names, devices, network, monitors) gui.Show(True) elif len(arguments) != 0 and len(arguments) != 1: print("Error: one or no file path required\n") print(usage_message) sys.exit() else: [path] = arguments scanner = Scanner(path, names) parser = Parser(names, devices, network, monitors, scanner) if parser.parse_network(): # Initialise an instance of the gui.Gui() class #import app_base as ab #app = ab.BaseApp(redirect=False) #app = wx.App() gui = Gui("LogicSim", path, names, devices, network, monitors) gui.Show(True) error.ShowModal() app.MainLoop()
def __init__(self, config, agent): super().__init__(config) self.agent = agent self.agent.setup(2) self.gui = Gui(config)
def gui(): app = Gui() app.mainloop()
import requests from settings import totalInvested, offlineBalances from gdax import gdax_client from binance import binance_client from gui import Gui def check(): gdax_balances = gdax_client.getBalances() binance_balances = binance_client.getBalances() currencies = set(dict.keys(gdax_balances)) | set(dict.keys(binance_balances)) | set(dict.keys(offlineBalances)) balances = { c: gdax_balances.get(c, 0) + binance_balances.get(c, 0) + offlineBalances.get(c, 0) for c in currencies } prices_raw_data = binance_client.get_all_prices() btc_eur_price = gdax_client.get_btc_eur_price() prices = { p['symbol'][:3] : float(p['price']) * btc_eur_price for p in prices_raw_data if p['symbol'][-3:]=='BTC'} prices['BTC'] = btc_eur_price prices['EUR'] = 1 balancesInEur = { c: prices[c] * balances.get(c, 0) for c in currencies } totalInEur = sum([balancesInEur[k] for k in balancesInEur]) return balances, prices, balancesInEur, totalInEur gui = Gui(totalInvested, lambda: check()) gui.render()
def main(): root = Tk() interface = Gui(root) root.mainloop()
def initialize_agent(self): self.tournament = True self.startup_time = time_ns() self.debug = [[], []] self.debugging = not self.tournament self.debug_lines = True self.debug_3d_bool = True self.debug_stack_bool = True self.debug_2d_bool = False self.show_coords = False self.debug_ball_path = False self.debug_ball_path_precision = 10 self.debug_vector = Vector() self.disable_driving = False self.goalie = False self.jump = True self.double_jump = True self.ground_shot = True self.aerials = True T = datetime.now() T = T.strftime("%Y-%m-%d %H;%M") self.traceback_file = (os.getcwd(), f"-traceback ({T}).txt") self.predictions = { "closest_enemy": 0, "own_goal": False, "goal": False, "team_from_goal": (), "team_to_ball": (), "self_from_goal": 0, "self_to_ball": 0, "was_down": False, "enemy_time_to_ball": 7, "self_min_time_to_ball": 7 } self.match_comms = MatchComms(self) self.print("Starting the match communication handler...") self.match_comms.start() self.ball_prediction_struct = None self.print("Building game information") match_settings = self.get_match_settings() mutators = match_settings.MutatorSettings() gravity = (Vector(z=-650), Vector(z=-325), Vector(z=-1137.5), Vector(z=-3250)) base_boost_accel = 991 + (2 / 3) boost_accel = (base_boost_accel, base_boost_accel * 1.5, base_boost_accel * 2, base_boost_accel * 10) boost_amount = ("default", "unlimited", "slow recharge", "fast recharge", "no boost") game_mode = ("soccer", "hoops", "dropshot", "hockey", "rumble", "heatseeker") self.gravity = gravity[mutators.GravityOption()] self.boost_accel = boost_accel[mutators.BoostStrengthOption()] self.boost_amount = boost_amount[mutators.BoostOption()] self.game_mode = game_mode[match_settings.GameMode()] if self.game_mode == "heatseeker": self.print("Preparing for heatseeker") self.goalie = True if not self.tournament: self.gui = Gui(self) self.print("Starting the GUI...") self.gui.start() self.friends = () self.foes = () self.me = car_object(self.index) self.ball_to_goal = -1 self.ball = ball_object() self.game = game_object() self.boosts = () self.friend_goal = goal_object(self.team) self.foe_goal = goal_object(not self.team) self.stack = [] self.time = 0 self.ready = False self.controller = SimpleControllerState() self.kickoff_flag = False self.kickoff_done = True self.shooting = False self.odd_tick = -1 self.best_shot_value = 92.75 self.future_ball_location_slice = 180 self.min_intercept_slice = 180 self.playstyles = Playstyle self.playstyle = self.playstyles.Neutral self.can_shoot = None self.shot_weight = -1 self.shot_time = -1
from cell import Cell from gui import Gui from simulation import Simulation #On déclare une simulation, une cellule et une interface pour avoir acccès au fonction de la classe. simulation1=Simulation() simulation1.SetLongueur() simulation1.SetLargeur() t=simulation1.GetLongueur() p=simulation1.GetLargeur() simulation1.SetNbGen() nb=simulation1.GetNbGen() cellule1=Cell(t,p) interface = Gui(t,p) interface.getligne() interface.getcolone() interface.start() for x in range(t): for y in range(p): interface.updateCell(x,y,randint(0,1)) #Affectue un motif aléatoire #interface.SaveClick(x,y) for i in range (nb): simulation1.CalculNbrVoisin() simulation1.CalculregleVoisin() for x in range(t): for y in range(p):
from gui import Gui if __name__ == '__main__': new_gui = Gui() new_gui.main_loop()
from board import Board from gui import Gui BOARD_SIZE = 4 REQUIRED_FOR_WINNING = 3 if __name__ == '__main__': b = Board('X', 'O', BOARD_SIZE, REQUIRED_FOR_WINNING) b.cpu_move() Gui(b).show()
from computer import Computer from game import Game from ui import Ui from board import Board from gui import Gui computer = Computer() board = Board() game = Game(board, computer) ui = Ui(game) gui = Gui(game) gui.start()
import sys from gui import Gui import time from PyQt5.QtWidgets import QMainWindow, QApplication, QAction, qApp, QWidget, QVBoxLayout, QTabWidget, QPushButton, \ QInputDialog, QLineEdit interface = Gui() interface.start()
import os import sys import time import yaml from global_logger import GLOBAL_LOGGER from dbt_git import dbt_git from gui import Gui from warehouse import Warehouse from scaffold import Scaffold logger = GLOBAL_LOGGER win = Gui() table_selections = dict() def main(args=None): global column_preferences column_preferences = dict() config_file = os.path.sep.join( [os.path.expanduser('~'), '.dbt_gen', 'config.yml']) log_file = os.path.sep.join( [os.path.expanduser('~'), '.dbt_gen', 'dbt_gen.log']) config = determine_config_status(config_file) print(config['templates']) sys.exit() model_groups = [
import os from gui import Gui from event_handler import EventHandler DEBUG = 50 # 1 - Apresentar Dict vertices e edges # 2 - Apresentar Adjs e cor # 3 - Apresentar Predecessor e Estimativa # 50 - Auto colocar vertices if "DEBUG" in os.environ: DEBUG = int(os.environ["DEBUG"]) W_SIZE = 1080 H_SIZE = 720 g = Gui(None, title="Trb M3 - Grafos", size=(W_SIZE, H_SIZE)) e = EventHandler(g, DEBUG) g.set_evt_handler(e) g.add_menu_bar() g.Show() g.main_loop()
from gui import Gui gui = Gui() gui.mainloop()
def draw_graph_from_result(cord: List[Tuple[float, float]], result_state: List[str], algo_name: str = ""): path = [cord[int(label) - 1] for label in result_state[:-1]] Gui(path, result_state[:-1], algo_name).draw_graph()