def login(): count = 0 while True: print(Fore.YELLOW + "LOGIN TO POLUX".center(80)) print("\n", "(Even if you can not see, password is typing ;))".center(80)) user = input("USERNAME:"******"PASSWORD:"******"Too much tryings...") stop_program() else: clear() print(Fore.RED + "User invalid, try again...".center(80)) count += 1 print(Style.RESET_ALL)
def menu(): run = True while run: pygame.time.delay(10) c.win.fill(cl.white) if_close() keys = pygame.key.get_pressed() if keys[pygame.K_c]: splash() pygame.display.update() time.sleep(1)
def start(): run = True while run: pygame.time.delay(10) if_close() keys = pygame.key.get_pressed() if keys[pygame.K_c]: splash() if keys[pygame.K_SPACE]: run = False c.win.fill(cl.dark_white) draw_img(0, 0, img.start_bg) draw_img(105, 215, img.mylogo_rose) gm_print('Welcome', 50, (150, 150), cl.dark_rose) gm_print('Press space to continue...', 30, (85, 400), cl.dark_rose) pygame.display.update() time.sleep(1)
def launch(name=None, **kwargs): """ Launches ZPUI, either in full mode or in single-app mode (if ``name`` kwarg is passed). """ global app_man i, o = init() appman_config = config.get("app_manager", {}) app_man = AppManager('apps', cm, config=appman_config) if name is None: try: from splash import splash splash(i, o) except: logging.exception('Failed to load the splash screen') logging.exception(traceback.format_exc()) # Load all apps app_menu = app_man.load_all_apps() runner = app_menu.activate else: # If using autocompletion from main folder, it might # append a / at the name end, which isn't acceptable # for load_app name = name.rstrip('/') # Load only single app try: app_path = app_man.get_app_path_for_cmdline(name) app = app_man.load_app(app_path, threaded=False) except: logging.exception('Failed to load the app: {0}'.format(name)) input_processor.atexit() raise cm.switch_to_context(app_path) runner = app.on_start if hasattr(app, "on_start") else app.callback exception_wrapper(runner)
def interactive_console(*functions, **flags): if not flags.get('nosplash', False): splash.splash(**flags) else: banner = 'HyperJ {}'.format(flags.get('version', '0.0.0')) print banner print len(banner) * '=' # Boring. while True: print '0)\t Exit' print '1)\t Setup flags' for i, j in enumerate(functions): print '{n})\t {name}'.format(n=i+2, name=j.__name__) try: c = int(raw_input('??) ')) except ValueError: print "!!)\t Incorrect value!" break if c == 0: print "!!)\t Bye!" exit(0) elif c == 1: print "!?)\t Change what flag?" flag = raw_input('??) ') print "!?)\t To what?" value = input('??) ') # Someone who you don't trust should not have access to this # console at any rate, so the use of input() here should be fine. flags[flag] = value else: if c >= 2: c -= 2 f = functions[c] print "!!)\t Interacting with {f}".format(f=f) while True: string = raw_input('#!) ') print f(string, **flags)
def on_continue(self): if len(self.folders_path) > 0: for path in self.folders_path: print(path, type(path)) d = databaseput.addfolder("startup", path) encode_faces.encoding() self.startup_win.destroy() runsplash = splash.splash() else: messagebox.showwarning("warning", "No Folders Selected Added") #startup_screen()
def launch(name=None, **kwargs): """ Launches ZPUI, either in full mode or in single-app mode (if ``name`` kwarg is passed). """ i, o = init() app_man = AppManager('apps', i, o) if name is None: try: from splash import splash splash(i, o) except: logging.exception('Failed to load the splash screen') logging.exception(traceback.format_exc()) # Load all apps app_menu = app_man.load_all_apps() runner = app_menu.activate else: # If using autocompletion from main folder, it might # append a / at the name end, which isn't acceptable # for load_app name = name.rstrip('/') # Load only single app try: app = app_man.load_app(name) except: logging.exception('Failed to load the app: {0}'.format(name)) i.atexit() raise runner = app.on_start if hasattr(app, "on_start") else app.callback exception_wrapper(runner, i, o)
def main(): """ The main function of the game. Side effects: Shows a splash screen. When the player clicks on the play button, lets the user play the game. If the user clicks on the quit button, close the window. """ w = GraphWin("The Hunger Games", 500, 500) while True: action = splash(w) if action == "quit": print("So Long, and Thanks for All the Fish!") w.close() exit() elif action == "play": game(w)
from config import alarm from transition import Transition from splash import splash alarm_wait = 10 post_alarm_wait = 30 transition_step_time = 0.1 def check(hour, minute): x = datetime.today() y = datetime.today().replace(minute = minute, hour = hour) return (x.hour == y.hour and x.minute == y.minute) def fire_alarm(): t = Transition(transition_step_time) t.start() time.sleep(post_alarm_wait) def schedule_alarm(hour, minute): while(check(hour, minute) == False): print(".") time.sleep(alarm_wait) fire_alarm() if(__name__ == '__main__'): splash() while(True): schedule_alarm(alarm["start_hour"], alarm["start_minute"])
if _verbosity_ > 0: print "pyraf: finished arg parsing" import iraf if _verbosity_ > 0: print "pyraf: imported iraf" iraf.setVerbose(verbose) del getopt, verbose, usage, optlist # If not silent and graphics is available, use splash window if _silent: _splash = None _initkw = {'doprint': 0, 'hush': 1} else: _initkw = {} if _dosplash: import splash _splash = splash.splash('PyRAF ' + __version__) else: _splash = None if _verbosity_ > 0: print "pyraf: splashed" # load initial iraf symbols and packages # If iraf.Init() throws an exception, we cannot be confident # that it has initialized properly. This can later lead to # exceptions from an atexit function. This results in a lot # of help tickets about "gki", which are really caused by # something wrong in login.cl # # By setting iraf=None in the case of an exception, the cleanup # function skips the parts that don't work. By re-raising the
import splash if __name__ == '__main__': run = splash.splash()
def splash_screen(): try: from splash import splash splash(i, o) except ImportError: pass
def callback(): try: #Testing I2C - 0x12 should answer, 0x20 should raise IOError with busy errno from smbus import SMBus bus = SMBus(1) try: bus.read_byte(0x12) except IOError: PrettyPrinter("Keypad does not respond!", i, o) else: PrettyPrinter("Keypad found!", i, o) #Checking IO expander expander_ok = False try: bus.read_byte(0x20) except IOError as e: if e.errno == 16: PrettyPrinter("IO expander OK!", i, o) expander_ok = True elif e.errno == 121: PrettyPrinter("IO expander not found!", i, o) else: PrettyPrinter("IO expander driver not loaded!", i, o) #Launching splashscreen import splash splash.splash(i, o) sleep(2) #Launching key_test app from app folder, that's symlinked from example app folder PrettyPrinter("Testing keypad", i, o, 1) import key_test key_test.init_app(i, o) key_test.callback() #Following things depend on I2C IO expander, #which might not be present: if expander_ok: #Testing charging detection bypass = Event() bypass.clear() PrettyPrinter("Testing charger detection", i, o, 1) from zerophone_hw import is_charging if is_charging(): PrettyPrinter( "Charging, unplug charger to continue \n Enter to bypass", i, o, 0) i.set_callback("KEY_ENTER", lambda: bypass.set()) #Printer sets its own callbacks, so we need to set #our callback after using Printer while is_charging() and not bypass.isSet(): sleep(1) else: PrettyPrinter( "Not charging, plug charger to continue \n Enter to bypass", i, o, 0) i.set_callback("KEY_ENTER", lambda: bypass.set()) while not is_charging() and not bypass.isSet(): sleep(1) i.remove_callback("KEY_ENTER") #Testing the RGB LED PrettyPrinter("Testing RGB LED", i, o, 1) from zerophone_hw import RGB_LED led = RGB_LED() for color in ["red", "green", "blue"]: led.set_color(color) Printer(color.center(o.cols), i, o, 3) led.set_color("none") #Testing audio jack sound PrettyPrinter("Testing audio jack", i, o, 1) if not downloaded.isSet(): PrettyPrinter( "Audio jack test music not yet downloaded, waiting...", i, o) downloaded.wait() disclaimer = [ "Track used:" "", "Otis McDonald", "-", "Otis McMusic", "YT AudioLibrary" ] Printer([s.center(o.cols) for s in disclaimer], i, o, 3) PrettyPrinter("Press C1 to restart music, C2 to continue testing", i, o) import pygame pygame.mixer.init() pygame.mixer.music.load(music_path) pygame.mixer.music.play() continue_event = Event() def restart(): pygame.mixer.music.stop() pygame.mixer.init() pygame.mixer.music.load(music_path) pygame.mixer.music.play() def stop(): pygame.mixer.music.stop() continue_event.set() i.clear_keymap() i.set_callback("KEY_F1", restart) i.set_callback("KEY_F2", stop) i.set_callback("KEY_ENTER", stop) continue_event.wait() #Self-test passed, it seems! except: exc = format_exc() PrettyPrinter(exc, i, o, 10) else: PrettyPrinter("Self-test passed!", i, o, 3, skippable=False)
CMIFDIR+":grins", CMIFDIR+":common:mac", CMIFDIR+":common", CMIFDIR+":lib:mac", CMIFDIR+":lib", # Overrides for Python distribution CMIFDIR+":pylib", ] sys.path[0:0] = CMIFPATH os.environ["CMIF"] = CMIFDIR #os.environ["CHANNELDEBUG"] = "1" # Next, show the splash screen import splash splash.splash('loadprog') import settings license = settings.get('license') user = settings.get('license_user') org = settings.get('license_organization') splash.setuserinfo(user, org, license) if len(sys.argv) > 1 and sys.argv[1] == '-p': profile = 1 del sys.argv[1] print '** Profile **' else: profile = 0 ## import trace
import GUI import duckduckgo import sphinxLib import eSpeaker import splash from lexicons import * DEFAULT_LEXICON = "lexicon.txt" lexicon_file = open(DEFAULT_LEXICON) lexicon = lexicon_file.read() splash1 = splash.splash() splash1.mainloop() root = GUI.GUI(eSpeaker.say,sphinxLib.RecordAndDecode,decode) root.mainloop()
def init(self): os.system("clear") splash.splash() self.lisa_reply = reply_engine.reply_engine() self.lisa_reply.init()
def clean_dir(dir): files = glob.glob(dir + "/*", recursive=True) for file in files: try: os.remove(file) except IsADirectoryError: pass pass pass clean_dir('./tmp/splash/') clean_dir('./tmp/Trailers/') clean_dir('./tmp/') # Stage 1 generating still frame splash().save_frame('./tmp/posters.png') # Stage 2 Overlaying trailers over still frame trailers = glob.glob('Trailers/*.mp4') if len(trailers) == 0: sys.exit("Please add trailer in the Trailers directory.") pass for trailer in trailers: p = subprocess.Popen(ffmpeg + ["-i", "./tmp/posters.png", "-i", "./{0}".format(trailer), "-c:a","copy", "-filter_complex", "[1:v:0]scale=900:506,setsar=1[a];[0:v:0][a] overlay=1020:574", "-map", "1:a", "-shortest", "-y", "./tmp/{0}".format(trailer)]) p.wait() pass # Stage 3 generating still frame with current session poster sessions = glob.glob('Sessions/*') if len(sessions) == 0:
else: print "Program bug, uninterpreted option", opt raise SystemExit iraf.setVerbose(verbose) del getopt, verbose, usage, optlist # If not silent and graphics is available, use splash window if _silent: _splash = None _initkw = {"doprint": 0, "hush": 1} else: _initkw = {} if _dosplash: import splash _splash = splash.splash("PyRAF " + __version__) else: _splash = None # load initial iraf symbols and packages if args: iraf.Init(savefile=args[0], **_initkw) else: iraf.Init(**_initkw) del args if _splash: _splash.Destroy() del _splash, _silent, _dosplash help = iraf.help
import pygame from splash import splash import config pygame.init() pygame.display.set_caption('GK') x = 23 y = 78 width = 70 height = 30 speed = 1 speed_x = 1 speed_y = 1 def moving(): keys = pygame.key.get_pressed() if keys[pygame.K_w] and y > 0: y -= speed if keys[pygame.K_s] and y < 500 - width: y += speed if keys[pygame.K_a] and x > 0: x -= speed if keys[pygame.K_d] and x < 500 - height: x += speed splash() pygame.quit()
try: opts, files = getopt.getopt(sys.argv[1:], 'qj:') except getopt.error, msg: usage(msg) if not files and sys.platform not in ('darwin', 'mac', 'win32'): usage('No files specified') if sys.argv[0] and sys.argv[0][0] == '-': sys.argv[0] = 'grins' try: import splash except ImportError: splash = None else: splash.splash(version='GRiNS ' + version) ## import Help ## if hasattr(Help, 'sethelpprogram'): ## Help.sethelpprogram('player') import settings kbd_int = KeyboardInterrupt if ('-q', '') in opts: sys.stdout = open('/dev/null', 'w') elif settings.get('debug'): try: import signal, pdb except ImportError: pass else:
if _verbosity_ > 0: print "pyraf: finished arg parsing" import iraf if _verbosity_ > 0: print "pyraf: imported iraf" iraf.setVerbose(verbose) del getopt, verbose, usage, optlist # If not silent and graphics is available, use splash window if _silent: _splash = None _initkw = {'doprint': 0, 'hush': 1} else: _initkw = {} if _dosplash: import splash _splash = splash.splash('PyRAF '+__version__) else: _splash = None if _verbosity_ > 0: print "pyraf: splashed" # load initial iraf symbols and packages # If iraf.Init() throws an exception, we cannot be confident # that it has initialized properly. This can later lead to # exceptions from an atexit function. This results in a lot # of help tickets about "gki", which are really caused by # something wrong in login.cl # # By setting iraf=None in the case of an exception, the cleanup # function skips the parts that don't work. By re-raising the
import t3 try: from os import remove as unlink except ImportError: from uos import unlink t3.start_task(t3._sys_task()) try: f = open('selected-game') except OSError: import splash import launcher t3.start_task(splash.splash()) else: with f: name = f.read().strip() unlink('selected-game') module = __import__(name) t3.start_task(module.main()) t3.run() # 1/5 000000 000000 000000 000000 000000 000000 000000 000000 000000
img2 = ImageTk.PhotoImage(ImG.open("media/images/realtime.jpg")) panel2 = Label(root, image=img2).grid(row=7, column=1, rowspan=2, sticky="nes") rt = Button(root, text="Realtime") rt.bind("<Button-1>", realtime) rt.grid(row=7, column=0, rowspan=2, sticky="ew") ex = Button(root, text="Exit") ex.bind("<Button-1>", exitf) ex.grid(row=9, columnspan=2, sticky="ew") root.mainloop() spl.splash() fol = Tk() fol.iconbitmap('media/icons/save.ico') fol.title("Testing Folder Selection") Label(fol, text="Choose the folder containing Testing Images:").grid(row=0, column=0, sticky=W) img = ImageTk.PhotoImage( ImG.open("media/images/folder_selection.jpg").resize((250, 250), ImG.ANTIALIAS)) panel = Label(fol, image=img).grid(row=1, column=0, rowspan=2, sticky="ew") folentry = Entry(fol, width=77) folentry.grid(row=3, sticky=W, column=0) ch = Button(fol, text="Browse") ch.bind("<Button-1>", askfolder)