Skip to content

Instantly share code, notes, and snippets.

@gabbygobln
Created December 23, 2025 20:59
Show Gist options
  • Select an option

  • Save gabbygobln/43112c7ac4830fd7c885eaf94fbd0dc7 to your computer and use it in GitHub Desktop.

Select an option

Save gabbygobln/43112c7ac4830fd7c885eaf94fbd0dc7 to your computer and use it in GitHub Desktop.
A simple python script that takes an alphanumeric input and splits it evenly into groups of 3-4 characters.
from re import findall
import io
import time
timestamp = time.strftime("%G.%m.%d_UTC%z_%H.%M.%S",time.localtime(time.time()))
data = input("data-input> ")
matches = findall(r"[a-zA-Z0-9]{3,4}", data)
print(matches)
def match_to_markdown_list (title, matches):
list_item = ""
for match in matches:
list_item += ("- [ ] " + f"{match}\n")
return (f"# {title}\n{list_item}")
outstream = match_to_markdown_list("example title", matches)
fstream = open(f"./hashchunk_list+{timestamp}.md", "w", encoding="utf-8")
fstream.write(outstream)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment