Skip to content

Instantly share code, notes, and snippets.

View yashrathi-git's full-sized avatar
🎯
Focusing

Yash Rathi yashrathi-git

🎯
Focusing
View GitHub Profile

Python code using turtle to draw a star:

import turtle

star = turtle.Turtle()

for i in range(5):
    star.forward(100)
    star.right(144)
import pdf2image
from PIL import ImageOps
import img2pdf
import os
import sys
from pathlib import Path
from random import randint
def invert_color(filepath):
@yashrathi-git
yashrathi-git / README.md
Last active March 1, 2022 17:29
My kitty terminal configuration file
@yashrathi-git
yashrathi-git / 1-python-pretty-print-timedelta.py
Last active September 8, 2021 05:25
Pretty print a time delta in Python in weeks, days, hours, minutes and seconds
def pprint_timedelta(delta: timedelta):
duration_units = (
('week', 60 * 60 * 24 * 7),
('day', 60 * 60 * 24),
('hour', 60 * 60),
('min', 60),
('second', 1)
)
seconds = int(delta.total_seconds())