This file contains 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 python | |
import json | |
import re | |
import sys | |
from zipfile import ZipFile | |
img_regex = re.compile(rb'!\[[^\]]*\]\(([^)]+)\)') |
This file contains 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
import json | |
def input_choice(prompt, choices): | |
value = None | |
prompt += '(' + '/'.join(choices) + ') ' | |
while value not in choices: | |
print('Valeur invalide') | |
value = input(prompt) | |
return value |
This file contains 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
import asyncio | |
import time | |
from celery import Celery | |
app = Celery('tasks') | |
class TaskBackend: |
This file contains 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 python | |
import itertools | |
import random | |
from collections import Counter | |
from enum import IntEnum | |
card_ranks = range(2, 15) | |
card_colors = '♠♥♦♣' | |
cards = list(itertools.product(card_ranks, card_colors)) |
This file contains 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
class tail_rec: | |
inside = False | |
def __init__(self, func): | |
self.func = func | |
def __call__(self, *args, **kwargs): | |
if tail_rec.inside: | |
self.args = args | |
self.kwargs = kwargs |
This file contains 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 python2 | |
from glob import glob | |
#logins = glob('*.jpg') | |
#logins.sort() | |
#print '\n'.join(["'%s' : ''," % l.replace('.jpg', '') for l in logins]) | |
logins = { | |
'arambu_b' : 'benjamin', |