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
def files_under(directory, recursive=True): | |
root = Path(directory) | |
pattern = '**/*' if recursive else '*' | |
yield from root.glob(pattern) |
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 csv | |
# import RPi.GPIO as GPIO #library for raspberry pins | |
import time | |
from collections import OrderedDict | |
from appJar import gui | |
HYDROREELS = OrderedDict() | |
HYDROREELS['125'] = ( | |
(1.98, 1.93, 31.17), |
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 re | |
from operator import add, sub, mul, floordiv, truediv | |
from functools import reduce | |
import itertools | |
OPERATIONS = ( | |
(re.compile('\+'), add), | |
(re.compile('(?<=[\d\)])-'), sub), # not match the - in `(-1)` | |
(re.compile('\*'), mul), | |
(re.compile('//'), floordiv), | |
(re.compile('/'), floordiv), # or '/': truediv, |
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
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue Mar 20 17:18:39 2018 | |
@author: Dimitar Dimov | |
""" | |
import PIL | |
import Tkinter | |
import Tkinter as Tk |
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
from enum import IntEnum | |
from itertools import repeat | |
from PIL import Image | |
BUFFER_PEG = 10 | |
LINE_WIDTH = 1 | |
BUFFER_STEP = 5 | |
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
from itertools import chain | |
from my_hanoi import ( | |
pad_disk, | |
format_row, | |
buffer_peg, | |
pad_left_reverse, | |
solve_tower, | |
) |