def playDay(barry, dayEventValues): # day is an integer value ranging from 0 to 6 loading.load_string("The start of a new day! You roll out of bed, stretching and yawning, preparing yourself to take on the day, whatever it entails. You are on-call this week, so you should be kept busy.", 200) loading.load_string("You sit at your desk and wait for the work to come...", 50) loading.loading(1, 3) loading.load_string("Event!!\n" + dayEvents[dayEventValues[0]]['name']) loading.load_string(dayEvents[dayEventValues[0]]['descrip'], 80) loading.load_string("SOLVE THIS PROBLEM: (NO CALCULATORS, USE MENTAL MATH! :-) )", 20) loading.loading(1, 6) loading.load_string( dayEventValues[1][0]) # prints math q answerIsInt = False while answerIsInt == False: answer = raw_input() try: answer = int(answer) answerIsInt= True except: print "Please enter an integer" if int(answer) == dayEventValues[1][1]: loading.playSound('woohoo') loading.load_string("CORRECT!") happyChange = dayEvents[dayEventValues[0]]['passEffect'][1] cashChange = dayEvents[dayEventValues[0]]['passEffect'][0] barry.changeMeter('cash', cashChange) barry.changeMeter('happy', happyChange) else: loading.playSound('doh') loading.load_string("WRONGO!") happyChange = dayEvents[dayEventValues[0]]['failEffect'][1] cashChange = dayEvents[dayEventValues[0]]['failEffect'][0] barry.changeMeter('cash', cashChange) barry.changeMeter('happy', happyChange)
def menu(): print('%s1.%s Loading example' % (fg('red'), attr('reset'))) print('%s0.%s Exit' % (fg('red'), attr('reset'))) choice = int(input()) clear() if choice == 1: loading()
def notification(): if os_type().upper() == 'WINDOWS': a = loading(function=windows) elif os_type().upper() == 'LINUX': linux() else: pass
def main(): path = "run" try: shutil.rmtree(path) except: print "aucun dossier run" if not os.path.exists(path): os.makedirs(path) # get the names of the pdf files filepathCorr,filepathEleves, listeEleves = interface(); # get the scores while displaying loading bar answersCorr,answersEleves,scores = loading(filepathCorr,filepathEleves) # prompt the names of the students names = promptNames(scores[0], listeEleves) # export results export.exportIndiv(scores[0], names) export.exportClasse(scores[1],scores[2]) # debug : export the answers given by the students (ABCD) in CSV #export.exportAnswersEleves(answersEleves, names) rename_images(names) root = tk.Tk() root.withdraw() tkMessageBox.showinfo("Terminé", "Export terminé : résultats dans moyennes_classe.csv et scores_individuels.csv") root.destroy()
def main(): players = nmrJogadores(maxPlayers) nickName = [] d20s = [] pos = [] personagens = [] hp = [] almtrVtrs(players, pos, personagens, hp) nomePlayers(players, nickName, d20s) definirSequencia(players, pos, d20s) i = 0 while i < players: print(nickName[pos[i]], end=' seu d20 caiu em --> ') print(d20s[pos[i]]) i += 1 print() print("-=" * 15 + "-") print() pause() clear() escolhaPersonagem(players, nickName, pos, personagens, hp) pause() clear() loading() turnoBatalhas(players, nickName, pos, personagens, hp)
def start(self): print("Ok Button has been clicked.") train = self.ui.trainingLine.text() test = self.ui.testingLine.text() test_std_select = self.ui.testingLine_2.text() print("Test: ", train) if (train == "" or test == "" or test_std_select == ""): print("Please select all the files.") msg = QMessageBox() msg.setIcon(QMessageBox.Critical) msg.setWindowTitle("Error") msg.setText( "You have not select all the datasets. Select all the valid datasets." ) msg.exec() del msg return load_dialog = loading(self) load_win = loadthread(self, load_dialog) compute_thread = compute(self, train, test, test_std_select) load_dialog.connect(compute_thread, SIGNAL("finished()"), load_dialog, SLOT("close()")) self.connect(compute_thread, SIGNAL("finished()"), lambda: load_win.terminate()) load_win.start() compute_thread.start() load_dialog.exec() # load_dialog.ui.progressBar.setV global res print(res) if res != 0: message = QMessageBox(self) message.setIcon(QMessageBox.Critical) message.setWindowTitle("Error") message.setText(str(res)) message.exec() res = 0 return self.close() result = res_window(self) result.show()
def set_loading(self): self.elements = [] load = loading.loading() load.set_position((self.W / 2 - load.W / 2, self.H / 2 - load.H / 2)) self.elements.append(load)
def load(): delay_ = 17 from loading import loading loading(delay_) l.acquire()
import pygame import random import time import os import sys import loading pygame.init() loading.loading() white = (255, 255, 255) yellow = (254,231,21) red = (213, 50, 80) green = (43,174,102) blue = (50, 153, 213) whiteblack = (16,24,32) orange = (242,170,76) lblue=(139,190,232) width = 700 height = 500 dis = pygame.display.set_mode((width, height)) pygame.display.set_caption('Snake Game') clock = pygame.time.Clock() snake_block = 10 snake_speed = 15
from loading import loading from gen_json import CreateJson from ScoreFunc import ScoreFunc from datetime import datetime import json from collections import OrderedDict # load the models corpora, tfidf, index, tfidf_dict, tfidf_web, \ mean_dict, ball_tree, d2v_model, des_dict, w2v_model, key_dict = loading() # class for rank, len, score computation cs = CreateJson(corpora, tfidf, index, tfidf_dict, tfidf_web, mean_dict, ball_tree, d2v_model, des_dict, w2v_model, key_dict) def main(weblist): """run the main for a not ordered example :)""" a = datetime.now() dictionary = cs.get_json(weblist, ScoreFunc(), n=10, only_web=False) # get dictionary from c_json # order everything by the total score if dictionary: dictionary_sort = OrderedDict(sorted(dictionary[u'output'].items(), key=lambda x: x[1][u'total_score'])[:10]) # read it as a json object json_obj = {'input_website_metadata': dictionary[u'input_website_metadata'], 'output': [{'website': website, 'data': data} for website, data in dictionary_sort.iteritems()]} else: json_obj = {'error': 'websites not present in the models'}
# script for running a bottle service for website/company similarity # ---------------------------------------------------------------------- from gen_json import CreateJson from loading import loading from bottle import Bottle, run, request, error, static_file, response from ScoreFunc import ScoreFunc from company_sim import * import json import pickle from datetime import datetime import shelve # load the models needed (from loading.py) corpus, tfidf, lsi, lsi_index, tfidf_dict, tfidf_web, db_mean_value, \ ball_tree, id_to_web, d2v_model, db_des, w2v_model, db_key, len_dict = loading() # load the database (company_id -> company information) that is needed in company similarity print datetime.now(), "loading company -> websites database" id_key = shelve.open('source/id_key_db.db') # load the dictionary (website -> company_id that owns it) that is needed in company similarity print datetime.now(), "loading websites -> company dictionary" inp_file = open('source/web_key.pkl', 'r') web_key = pickle.load(inp_file) inp_file.close() print datetime.now(), "finished loading, initialize the classes" # initialize the class for rank, len, partial score computation c_json = CreateJson(corpus, tfidf, lsi, lsi_index, tfidf_dict, tfidf_web, db_mean_value,
#!/usr/bin/python # Loading window opens # Exits if connection to server fails import loading load = loading.loading() if load.status['loading'] == 'fail': exit() goto = 'login' # Loop so that one window can refer several other windows while goto != None: nextGoto = None # Login window if goto == 'login': import login log = login.login() if log.status['login'] == 'forgotpass': import forgotpass forgotpass.forgotPassword() nextGoto = 'login' elif log.status['login'] == 'register': import register register.register() nextGoto = 'login' elif log.status['login'] == 'pass': server = log.server nextGoto = 'home' else: exit()
import sys import asyncio import aiohttp import requests import json from datetime import datetime from time import time from man import * from models import User, Params, Query from loading import loading start = time() loading = loading() len_name = set() requests_count = 0 reset_time = datetime.now() user = User() if user.authorized: params = Params() params.validation() query = Query(params) print( f"Start from: {params.start_date}\nTo: {params.end_date}\nbranch: {params.branch}\n" ) else: print(man_no_auth) exit() # convert string created time to <datetime> whithout 'Z'
def load(): loading.loading() loading.loadcopy()