Skip to content

Instantly share code, notes, and snippets.

View Jiler01's full-sized avatar
💭
∃!

Jiler JL Jiler01

💭
∃!
  • France
  • 08:12 (UTC +01:00)
View GitHub Profile
@Jiler01
Jiler01 / Loading_animation.py
Last active May 12, 2024 20:33 — forked from rudrathegreat/Loading.py
A Simple Loading Animation Decorator For the Command Line Using Python 3
"""
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
@Jiler01
Jiler01 / match.py
Created December 10, 2023 15:16
Some easy-to-use best matches seeker using linear search (possible improvements on the sorting loop
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)
@Jiler01
Jiler01 / jsonTools.py
Created December 10, 2023 15:13
Some easy-to-use json dict storage system
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):
@Jiler01
Jiler01 / PileFIFOLIFO.py
Created December 10, 2023 15:11
Some easy-to-use FIFO/LIFO implementation in python
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):