Пример #1
0
def main(argv):
    import argparse
    parser = argparse.ArgumentParser(description='obs installation sanity checker')
    parser.add_argument('-i', "--installation", dest='installs', action='append', default=def_installs)
    args = parser.parse_args(argv[1:])

    from check_obs import check_obs
    exc, plugin_dump = check_obs(args.installs)
    from gui import run_gui
    run_gui(exc, plugin_dump)
Пример #2
0
def main():

    """ Application start """

    logging.basicConfig(level=logging.INFO)

    get_module_logger().setLevel(logging.INFO)

    arg_parser = get_arg_parser()
    args = arg_parser.parse_args()

    # The call to run() does not return.
    # All events are handled via GUI handlers and application callbacks.

    _ = Application(args)

    run_gui()
Пример #3
0
def main():

    """ Application start """

    logging.basicConfig(level=logging.INFO)

    get_module_logger().setLevel(logging.INFO)

    arg_parser = get_arg_parser()
    args = arg_parser.parse_args()

    conf_parser = configparser.RawConfigParser()
    conf_parser.read_file(codecs.open("config.ini", "r", "utf8"))

    # The call to run() does not return.
    # All events are handled via GUI handlers and application callbacks.

    _ = Application(args, conf_parser)

    run_gui()
Пример #4
0
def edjust(ctx, input_folder):
    """Adjust pose of 3D object"""

    rgb, gray, scene = read_input(input_folder)
    integral_calculator = IntegralCalculator(gray,
                                             scene,
                                             normalized_gradient=True)
    model_queue = SimpleQueue()
    process = Process(target=run_optimization,
                      args=(scene.model, integral_calculator, model_queue))
    process.start()
    exit_code = run_gui(sys.argv[:1], rgb, scene, integral_calculator,
                        model_queue)
    process.terminate()
    ctx.exit(exit_code)
Пример #5
0
from tkinter import *
import tkinter as tk

from gui import run_gui

if __name__ == '__main__':
    run_gui()
Пример #6
0
import gui

gui.run_gui()
exit()
Пример #7
0
    args = parser.parse_args()

    if args.custom_coords is not None:
        lat, lon = args.custom_coords.strip().split(',')
        utils.REF_LAT, utils.REF_LON = float(lat), float(lon)
    else:
        utils.set_loc_ip()
    print(f'Using reference coordinates of: {utils.REF_LAT}, {utils.REF_LON}')

    msg_que = Queue()
    if args.input is not None:
        print(f"Using MockRadio with {args.input}")
        radio = MockRadio(msg_que, args.input, args.repeat, args.delay,
                          args.delay)
    else:
        print('Setting up radio')
        radio = Radio(msg_que)
        print('Done')

    if args.gui:
        run_gui(radio, args.debug)
    else:
        while True:
            msgs = radio.get_all_queue()
            for m in msgs:
                if m.valid:
                    print(m)
                if args.output is not None and (m.valid
                                                or args.output_invalid):
                    args.output.write(f'{round(time.time())} {m.bin_msg}\n')
Пример #8
0
def main():

    gui.run_gui()
Пример #9
0
        if scores[row][col] > max_score:
            choose = []
            choose.append((empty[tile][0], empty[tile][1]))
            max_score = scores[row][col]
        
        if scores[row][col] == max_score:
            choose.append((empty[tile][0], empty[tile][1]))
    
    return random.choice(choose)

    
def mc_move(board, player, trials):
    """
    When this function is called, 
    it submits the machine's move.
    """
    scores = [[0 for dummy_row in range(0, board.get_dim())] for dummy_col in range(0, board.get_dim())]
    for dummy_trial in range(0, trials):
        
        trial_board = board.clone()
        mc_trial(trial_board, player)
        mc_update_scores(scores, trial_board, player)
    
    move = get_best_move(board, scores)
    
    return (move[0], move[1])


#provided.play_game(mc_move, NTRIALS, False)        
gui.run_gui(3, provided.PLAYERX, mc_move, NTRIALS, False)
Пример #10
0
        4 10% of the time.
        """
        #Creates list of empty tiles
        empty_tiles = [(row,col) for row in xrange(self.get_grid_height())
                      for col in xrange(self.get_grid_width()) 
                      if not self.get_tile(row,col)]

        new_tile = random.choice(empty_tiles)
        self.set_tile(new_tile[0],new_tile[1],random.choice(self._two_four))
        

    def set_tile(self, row, col, value):
        """
        Set the tile at position row, col to have the given value.
        """
        
        self._grid[row][col] = value

    def get_tile(self, row, col):
        """
        Return the value of the tile at position row, col.
        """
        
        return self._grid[row][col]


gui.run_gui(TwentyFortyEight(4,4))



Пример #11
0
from config import log

if __name__ == '__main__':

    # Read initial parameters from the client
    init = list(map(int, read_line().split(' ')))

    log.critical(init)

    player_id = init[0]
    time_limit = init[1]
    game_mode = init[2]
    no_board = not bool(init[3])

    log.debug("My Player ID: %d", player_id)
    log.debug("Time Limit: %d", time_limit)
    log.debug("Game Mode: %d", game_mode)
    log.debug("Drawing Board: %d", no_board)

    if no_board:

        game = LudoGame(player_id, game_mode)
        game.run(no_board=True)

    else:

        # This makes the dependency on PyQt optional!
        # TODO: What if no_board is false; but PyQt was not found?
        import gui
        gui.run_gui(player_id, game_mode)
Пример #12
0
    if len(sys.argv) == 1: 
        sys.stderr.write("Missing arguments\n")
        parser.print_help(sys.stderr)
        sys.exit(1)
        
    args = parser.parse_args()
    return args
   
#####################################
###### MAIN SCRIPT ##################
#####################################
if __name__ == "__main__":
    args = setup_cmd_parser()

    if args.gui:
        run_gui(args)
    
    else:
        print("*"*40)
        print("PyGTV version: " + VERSION)
        print("Exporting GIS data to VTK format...")
        print("Path to shape file(s): " + args.src)
        print("VTK output file: " + args.dst)
        print("Run gui: " + str(args.gui) )
        print("Verbose: " + str(args.verbose) )
        print("Default elevation: " + str(args.elev) )
        print("-"*40)

        # DO SOME CHECKING FOR DST (EXIST?, CREATE?, ETC)
        files_src, files_dst = get_file_list(args.src, args.dst)
        export_files(files_src, files_dst, args.elev, args.verbose)
Пример #13
0
        if len(positions_with_zeros) == 0:
            return None

        random_tile = random.choice(positions_with_zeros)

        new_tile_in_play = random.choice([2,2,2,2,2,2,2,2,4])

        self.set_tile(random_tile[0],random_tile[1], new_tile_in_play)


    def set_tile(self, row, col, value):
        """
        Set the tile at position row, col to have the given value.
        """
        # manually set the value to the list

        self.grid[row][col] = value


    def get_tile(self, row, col):
        """
        Return the value of the tile at position row, col.
        """
        # one-liner - returns value from list

        return self.grid[row][col]


gui.run_gui(TwentyFortyEight(4, 4))
Пример #14
0
#!/usr/bin/env python3

from core import run
from gui import run_gui
from sys import argv

if len(argv) == 2 and argv[1] == '--help':
    print ("linkinator --help")
    print ("linkinator <source-path> <destination-path>")
    print ("linkinator")
elif len(argv) == 3:
    p = argv[1:]
    run(p[0], p[1])
else:
    run_gui(run)
from driving.model import *
from driving.reward import DrivingReward
from mdp.solver import QLearningSolver
from numpy import array
from gui.run_gui import *

reward = DrivingReward()
reward.params = array(
    [0.05, 0.02, 0.01, 0.2, 0.5, 0.6, 0.7, 0.8, -3, -0.05, -0.01])
model = DrivingModel()
model.reward_function = reward
model.dim = 11
qsolver = QLearningSolver(5000)
agent = qsolver.solve(model)
print agent.param
run_gui(agent, model)
from driving.model import *
from driving.reward import DrivingReward
from mdp.solver import QLearningSolver
from numpy import array
from gui.run_gui import *

reward = DrivingReward()
reward.params = array([0.05, 0.02, 0.01, 0.2, 0.5, 0.6, 0.7, 0.8, -3, -0.05, -0.01])
model = DrivingModel()
model.reward_function = reward
model.dim = 11
qsolver = QLearningSolver(5000)
agent = qsolver.solve(model)
print agent.param
run_gui(agent, model)