def MyServer(): try: load() oschek().ch_os() inschek().ch_ins() menu() except KeyboardInterrupt: exit()
def remind(args, perms={}): # get time right now rn = datetime.now() # get the menu from where you want food = menu(args[1:], perms) l = map(int, re.findall('\d+', args[0])) try: assert len(l) <= 2 except: return 'Invalid time input!' if 'pm' in args[0]: l[0] += 12 want_dt = datetime(rn.year, rn.month, rn.day, l[0], l[1]) if want_dt > rn: sleep_time = (want_dt - rn).total_seconds() sleep(sleep_time) return food
#!/usr/bin/python3 import pygame, sys # import custom modules from modules.menu import menu from modules.areana import Areana from modules.showMessage import showMessage from modules.creditpage import creditpage # size of pygame window size = ([600, 500]) # list wrap into tuple because this value never change menu_return_value = menu(pygame, sys, size) if menu_return_value == 'play': # display menu if user click playButton call areana function(game areana) if Areana(pygame, sys, size).areana() == 'showMsg': # display message if user fail showMessage(pygame, sys, size) if menu_return_value == 'Credits': # display credits section by calling creditPage if user click credits button creditpage(pygame, sys, size)
bar_coord = COL.verif_outside_auto(ball_coord, bar_coord) tk.mise_a_jour() time.sleep(C.FREQUENCE) time_spend = actu_time(time_spend) ########### Si Boucle principale finie ################################################ tk.ferme_fenetre() ########### Corps principal ############################################################## if __name__ == "__main__": if len(sys.argv) < 2 or len(sys.argv) > 2: choix = ME.menu() elif sys.argv[1] == "auto": choix = "A" elif sys.argv[1] == "player": choix = "N" else: #Si il y a bien un sys.argv[1] mais qu'il n'est pas connu choix = ME.menu() if choix == "N": main() elif choix == "A": main_auto() elif choix[0] == "F": main(mode=choix) elif choix == "H":
from modules import funzioni, menu while (True): menu.menu() menu.clear()
else: oScreen.pulse() elif screenStatus == 1: # Loop until return key is pressed while True: affCurrent = time.time() - affStart oScreen.draw.rectangle( (0, oScreen.height - 1, (affCurrent * waitStep) * 1000, oScreen.height - 1), 0, 0) if swithRelease == 1: oRotary.triggerDisable() oScreen.cls() oMenu = menu.menu() oMenu.logger = logging oMenu.processmenu(oScreen, oRotary, menu_data) oRotary.setSwitchCallback(rotarySwitchCall) oRotary.setRotateCallback(rotaryRotateCall) oRotary.triggerEnable() swithRelease = 0 screenStatus = 0 oScreen.cls() break oScreen.display() if affCurrent > secondsWait: screenStatus = 0 oScreen.cls()
def __begin__(): response.menu=menu(request, 'index')
#other libs# time, signal, psutil, threading import time import signal import psutil from threading import Thread #app modules# io, stats, userPreferences, optionsMenu import modules.io as io import modules.stats as stats #import modules.webServer as server import modules.user_preferences as config from modules.menu import optionsMenu as menu #Gobal Vars# APPINDICATOR_ID = "SystemViewer" timeToUpdate = 1 menu = menu() class Indicator(): #Main# def __init__(self): #Indicator config.run() self.indicator = appIndicator.Indicator.new( APPINDICATOR_ID, 'whatever', appIndicator.IndicatorCategory.SYSTEM_SERVICES) self.indicator.set_status(appIndicator.IndicatorStatus.ACTIVE) self.indicator.set_menu(menu.menu()) self.indicator.set_label("CPU: " + str(psutil.cpu_percent()) + "%", APPINDICATOR_ID)