Beispiel #1
0
import score
score.init()
#score.run("Anyone know who Brit's support act is for tonight, Ticketmaster say Ciara is going home and not performing Feeling deflated. Hubby saw swing set & thinks is a piece of junk. I thought I had found something good 4 the kids @MelissaPeterman wondering what happend to you?  I had to go #to a funeral today.  Very sad @piginthepoke well that is good news - long may it continue!  I bet you are going to be really busy today!")

#score.run("Anyone know who Brit's support act is for tonight, Ticketmaster say Ciara is going home and not performing")
#score.run("I like the weather in seattle")
score.run("ugly view in my window, angry man doing bad coding")

Beispiel #2
0
def main():
    """
    Methode principale du programme,
    porte l'initialisation, la boucle de
    jeu et le calcul du résultat.
    """

    # Demander le nom du joueur
    print("Bonjour ! Prêt pour une nouvelle partie de pendu ?")
    name = input("Entrez votre nom :")

    score.init(name)

    format_print("Votre score actuel est de : {}", score.get())

    game.init(random_word.get())

    print("Mot choisi !\nC'est parti !")
    # Tant que pas trouver afficher le
    # mot decomposé
    first = True
    while game.can_play():

        if first:
            first = False
        else:
            print("Rejouez !")

        format_print("Il vous reste {} coups", game.get_countdown())
        format_print("Mot à trouver : {}", game.get_found())

        # On cherhche la proposition du
        # joueur dans le mot à trouver
        proposal = input("Proposez une lettre :")

        try:
            # Proposition trouvée : on
            # l'affiche et on peut rejouer
            if game.find(proposal):
                format_print("Oui ! Il y a bien un {} dans le mot.", proposal)

            # Sinon on perd un tour
            else:
                format_print("Et non, pas de {} dans le mot !", proposal)

        # Si la proposition n'est pas
        # correcte
        except ValueError as error:
            format_print("Erreur de proposition : {}", error)

    # Si trouvé en moins de 8 coups
    # enregistre le score
    if game.result():
        format_print(
            "Gagné !\nLe mot était bien {word}\nVous gagnez {score} points de score",
            word=game.get_to_find(),
            score=game.get_countdown())

        score.add(game.get_countdown())
        score.save()

    # Sinon, perdu !
    else:
        format_print("Perdu !\nLe mot était : {}", game.get_to_find())
Beispiel #3
0
import pandas as pd
import os
os.environ["AZUREML_MODEL_DIR"] = os.getcwd()

data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..',
                         'data', 'attrition.csv')

data = pd.read_csv(data_path)
data.head()

from score import init, run

init()
ret = run(data.head())

print(ret.__class__)
print(ret)
Beispiel #4
0
def test_score():
    os.environ["AZUREML_MODEL_DIR"] = "./outputs"
    init()
    result = run(input_sample)
    print(result)
    assert 'predict_proba' in result