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
""" | |
This program is designed to create | |
and animate a simple loading animation. | |
""" | |
from sys import stdout as terminal | |
from time import sleep | |
from itertools import cycle | |
from threading import Thread |
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 matches(target: str, data: str, cutoff: float): | |
if len(target) == 0: | |
raise ZeroDivisionError("Data must be at leat one character long") | |
score = 0.0 | |
for target_letter_index in range(len(target)): | |
if target[target_letter_index] in data: | |
score += .5 | |
if target_letter_index < len(data) and data[target_letter_index] == target[target_letter_index]: | |
score += .5 | |
score /= len(target) |
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 os,json | |
class DATA: | |
def __init__(self,name:str,*,default:dict={}): | |
""" | |
name: the name of the file which will be stored in the DATA folder (without extension) | |
default: default value which will be used only on file initialization. Use overwrite to modify the stored value. | |
""" | |
self.path = "DATA/"+name+".json" | |
if not os.path.exists(self.path): |
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 Maillon: | |
def __init__(self, before, value, next): | |
self.before = before | |
self.value = value | |
self.next = next | |
def set_next(self, value): | |
self.next = value | |
def set_before(self, value): |