def initShape(self): #Add Value tab self.decode = decodeValues(self.heditor) self.search = search(self.heditor) self.goto = goto(self.heditor) self.options = options(self.heditor) self.insertTab(0, self.decode, "Decode") self.insertTab(1, self.search, QIcon(":hex_search.png"), "Search") self.insertTab(2, self.goto, "Goto") self.insertTab(3, self.options, QIcon(":hex_opt.png"), "Options")
def choice(): showOptions() choice = -1 while not (choice < len(options()) and choice >= 0): try: choice = int(input('Option: ')) except: print('Input number') choice = -1 return choice
def initShape(self): #Add Value tab self.decode = decodeValues(self.heditor) self.search = search(self.heditor) self.goto = goto(self.heditor) self.options = options(self.heditor) self.insertTab(0, self.decode,"Decode") self.insertTab(1, self.search, QIcon(":hex_search.png") ,"Search") self.insertTab(2, self.goto, "Goto") self.insertTab(3, self.options, QIcon(":hex_opt.png"), "Options")
def Build( options = None, scriptfile = None, **kw ): if options is None: options = _BuiltinOptions() options.update( _ARGUMENTS ) if _generate_help( options ): return build_variants = options.build_variants builds = [] for v in _COMMAND_LINE_TARGETS: try: builds += build_variants.Convert( v ) except logging.ErrorException: pass if builds: build_variants.Set( builds ) for bv in options.build_variants.GetList(): BuildVariant( options = options( build_variant = bv ), scriptfile = scriptfile, **kw )
logging.basicConfig(level=logging.INFO) # Logging configuration logger = logging.getLogger('main') logger.setLevel(logging.INFO) ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) formatter = logging.Formatter( '%(asctime)s - %(levelname)s - %(message)s') ch.setFormatter(formatter) logger.addHandler(ch) {%- if cookiecutter.use_logstash.startswith('y') -%} logstash_options = options()['logstash'] ls = logstash.TCPLogstashHandler( host=logstash_options['host'], port=logstash_options['port']) ls.setLevel(logging.INFO) logger.addHandler(ls) {%- endif %} app = connexion.App("{{cookiecutter.project_name}}") application = app.app app.add_api("config/api.yml", strict_validation=True, validate_responses=True) if __name__ == '__main__': app.run(port=8080, server='flask')
def main_menu(): print("open main menu") done = False mainCount = 0 while not done: #clock.tick(10) for event in pygame.event.get(): if event.type == pygame.QUIT: quit() if event.type == pygame.KEYDOWN: if event.key == pygame.K_UP: mainCount = mainCount - 1 print(mainCount) if mainCount == -1: mainCount = 4 print(mainCount) if event.key == pygame.K_DOWN: mainCount = mainCount + 1 print(mainCount) if mainCount == 5: mainCount = 0 print(mainCount) #enter if event.key == pygame.K_RETURN: if mainCount == 0: #start #import the game pygame.mixer.music.stop() #stop music from main menu gameIntro(screen) elif mainCount == 1: #Options #import the Options options(screen) elif mainCount == 2: #help #import the help helps(screen) elif mainCount == 3: #credits showCredits(screen) elif mainCount == 4: quit() #Start #Options #Help #Credits #Quit screen.blit(menu_back, (0, 0)) #messageText("Jim's Big Win",450,500,50,screen,255,255,255,"/Users/weijingwang/Documents/GitHub/he-is-jim\ local/assets/fonts/ComicSansMSRegular.ttf")#/assets/fonts/ComicSansMSRegular.ttf #messageText("Jim's Big Win",450,500,50,screen,255,255,255,"Roboto") #Draw "Press Up and Down to move selection" #messageText("Press Up and Down to move selection",30,470,15,screen,255,255,255,"ComicSans") # messageText("Press",30,470,15,screen,244,67,54,"ComicSans") # messageText("Up",71,470,15,screen,255,87,34,"ComicSans") # messageText("and",95,470,15,screen,255,152,0,"ComicSans") # messageText("Down",123,470,15,screen,255,193,7,"ComicSans") # messageText("to",165,470,15,screen,255,235,59,"ComicSans") # messageText("move",183,470,15,screen,76,175,80,"ComicSans") # messageText("select",220,470,15,screen,0,150,136,"ComicSans") # messageText("tion",255,470,15,screen,0,188,212,"ComicSans") #messageText("Press Enter to Select",30,490,15,screen,255,255,255,"ComicSans") # messageText("Press",30,490,15,screen,3,169,244,"ComicSans") # messageText("En",70,490,15,screen,33,150,243,"ComicSans") # messageText("ter",87,490,15,screen,63,81,181,"ComicSans") # messageText("to",115,490,15,screen,103,58,183,"ComicSans") # messageText("Se",135,490,15,screen,156,39,176,"ComicSans") # messageText("lect",155,490,15,screen,233,30,99,"ComicSans") button("Start", 0, 50, 200, 50, False, screen) button("Options", 0, 100, 200, 50, False, screen) button("Help", 0, 150, 200, 50, False, screen) button("Credits", 0, 200, 200, 50, False, screen) button("Quit", 0, 250, 200, 50, False, screen) if mainCount == 0: button("Start", 0, 50, 200, 50, True, screen) elif mainCount == 1: button("Options", 0, 100, 200, 50, True, screen) elif mainCount == 2: button("Help", 0, 150, 200, 50, True, screen) elif mainCount == 3: button("Credits", 0, 200, 200, 50, True, screen) elif mainCount == 4: button("Quit", 0, 250, 200, 50, True, screen) else: print(mainCount) pygame.display.update()
def __init__(self): self.options = options().parse() self.doc = document()
def main_menu(): print("open main menu") done = False mainCount = 0 while not done: #clock.tick(10) for event in pg.event.get(): if event.type == pg.QUIT: quit() if event.type == pg.KEYDOWN: if event.key == pg.K_UP: mainCount = mainCount - 1 # print (mainCount) if mainCount == -1: mainCount = 4 # print (mainCount) if event.key == pg.K_DOWN: mainCount = mainCount + 1 # print (mainCount) if mainCount == 5: mainCount = 0 # print (mainCount) #enter if event.key == pg.K_RETURN: if mainCount == 0: #start #import the game # done = True pg.mixer.music.stop() #stop music from main menu gameIntro(screen) elif mainCount == 1: #Options #import the Options options(screen) elif mainCount == 2: #help #import the help helps(screen) elif mainCount == 3: #credits showCredits(screen) elif mainCount == 4: quit() #Start #Options #Help #Credits #Quit screen.blit(menu_back, (0, 0)) messageText("press enter to select and arrow keys", 450, 470, 20, screen, 255, 255, 255, "Roboto") messageText("ain't got that flow if it isn't a flow", 50, 500, 50, screen, 255, 255, 255, "Roboto") button("Start", 0, 50, 200, 50, False, screen) button("Options", 0, 100, 200, 50, False, screen) button("Help", 0, 150, 200, 50, False, screen) button("Credits", 0, 200, 200, 50, False, screen) button("Quit", 0, 250, 200, 50, False, screen) if mainCount == 0: button("Start", 0, 50, 200, 50, True, screen) elif mainCount == 1: button("Options", 0, 100, 200, 50, True, screen) elif mainCount == 2: button("Help", 0, 150, 200, 50, True, screen) elif mainCount == 3: button("Credits", 0, 200, 200, 50, True, screen) elif mainCount == 4: button("Quit", 0, 250, 200, 50, True, screen) pg.display.update()
def process(self): self.show_main_menu() self.variable = input() should_exit = False options(self.variable) return should_exit
menu = ["Jouer", "Options", "Quitter"] nbMenu = len(menu) ouvert = True while ouvert: for event in pygame.event.get(): if event.type == QUIT: ouvert = False if event.type == KEYDOWN: if event.key == K_ESCAPE: ouvert = False if event.key == K_RETURN: if menu[selectionActuelle] == "Jouer": jouer(fenetre) if menu[selectionActuelle] == "Options": options(fenetre) if menu[selectionActuelle] == "Quitter": ouvert = False if event.key == K_UP: selectionActuelle -= 1 if selectionActuelle < 0: selectionActuelle = 0 if event.key == K_DOWN: selectionActuelle += 1 if selectionActuelle >= nbMenu: selectionActuelle = nbMenu - 1 fenetre.fill(couleurBlanche) # On efface l'ecran # On affiche le menu espacement = fenetre.get_rect().height / (nbMenu + 1)
THE = options( "python smore.py", """ SMORE: simple multi-objective rule engine (C) 2016,2017 Tim Menzies, George Mathews MIT, v2. The stuff we can use is either simple, or not at all.""", "", all=[ "Misc options.", h("disable all tests", brave=False), h("found for flags", rounding=3), h("verbose level (0=silent)", verbose=[0, 1, 2, 3]) ], sample=[ "Incrementally sample data.", h("samples per column", samples=256), h("small effect (Cliff's delta)", smallEffect=[0.147, 0.33, 0.474][0]) ], num=["Numeric samples.", h("never normalize", noNorms=False)], sym=["Samples of symbols.", h("bayesian k", k=1), h("bayesian m", m=2)], groups=[ "Groupings of distance", h("distance power", f=2), h("distance columns", cols=["objs", "decs"]), h("cull factor", cull=0.5), h("smallest group size", minGroup=30), h("split redos", splitRedo=20), h("split bigger", splitBigger=0.1) ])