Created
December 23, 2025 20:59
-
-
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.
This file contains hidden or 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
| 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