This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import time | |
import pytest | |
from app.Simple import Simple | |
@pytest.fixture() | |
def var() -> None: | |
return Simple(azerty=1, uiop=2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ENTITIES | |
CREATE TABLE address ( | |
id SERIAL PRIMARY KEY, | |
street_name TEXT NOT NULL, | |
home_number TEXT NOT NULL, | |
zip_code TEXT NOT NULL, | |
country TEXT | |
); | |
CREATE TABLE role ( | |
id SERIAL PRIMARY KEY, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from typing import NoReturn, Dict, Any, Optional, List | |
import requests | |
import json | |
class QwantData: | |
def __init__(self, json_str: bytes, wished_data: str) -> NoReturn: | |
parsed_json: Dict = json.loads(json_str) | |
if wished_data == 'artist': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Brangelina | |
The task of combining first names of celebrities into | |
a short catchy name for media consumption turns out | |
to be surprisingly simple to automate. Start by counting | |
how many groups of consecutive vowels (aeiou) there are | |
inside the first name. For example, "brad" and "ben" have |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import re | |
entree = os.path.join('chemin', 'vers le', '.md') | |
sortie = os.path.join('chemin', 'vers le', '.toc.md') | |
with open(entree) as md, open(sortie, 'w') as out: | |
for ligne in md: | |
if ligne[0] == '#': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import random | |
class Carte(): | |
couleurs = {'carreau': '♦', 'coeur': '♥', 'pique': '♠', 'trefle': '♣'} | |
noms = {"2" : 1, "3" : 2, "4" : 3, "5" : 4, "6" : 5, "7" : 6, | |
"8" : 7, "9" : 8, "10" : 9, "valet" : 10, "dame" : 11, | |
"roi" : 12, "as" : 13} | |
def __init__(self, nom, couleur): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
class Struct(): pass | |
def toObject(dictionnaire): | |
object = Struct() | |
for nom, element in dictionnaire.items(): | |
if isinstance(element, dict): | |
setattr(object, nom, toObject(element)) | |
else: | |
setattr(object, nom, element) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!C:/Users/SDQ/AppData/Local/Programs/Python/Python36/python.exe | |
""" | |
Permet la création d'un tableau MarkDown | |
sur base d'une liste de valeurs données ligne par ligne | |
(24 données, 4 colonnes) | |
""" | |
liste, i, flag = [], 0, False | |
for lg in open(__file__): # Pour chaque ligne du fichier |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import random | |
import time | |
import sys | |
# Classe qui définit un jeu de cartes | |
class JeuDeCartes: | |
def __init__(self): | |
# Un jeu possède des cartes de 4 couleurs | |
# mais est généralement utilisé en un seul paquet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
class Personne(): | |
def __init__(self, block): | |
block(self) | |
def __str__(self): | |
return "La personne s'appelle "+self.prenom+" "+self.nom.upper() | |
def init(pers): | |
pers.prenom = 'Seb' | |
pers.nom = 'Declercq' |