Skip to content

Instantly share code, notes, and snippets.

@sazeygit
sazeygit / ulam.py
Last active February 6, 2023 18:33
Ulam spiral sketcher using NumPy and tkinter optimisations
from itertools import count, cycle
from math import ceil, sqrt
from numpy import arange, array, full, ones, insert, where
from numpy import append as ap
from time import perf_counter as pf
from time import sleep
from tkinter import Canvas, Tk, constants
root = Tk()
# root.attributes('-fullscreen', True) # make fullscreen window
@sazeygit
sazeygit / typer-example.py
Last active December 29, 2022 15:13
Display strings using a typing and a ticker effect. Typing effect can also be used to capture input.
import typer as t
def main(stdscr):
string = "Hello World!"
# Simple typing of a string
t.label(string)
# String on same line (default)
# Delay (ms) can be adjusted to your liking (default is 40ms)
t.label(string, delay=20, nl=0)