Skip to content

Instantly share code, notes, and snippets.

@SonOfLilit
SonOfLilit / demux.py
Last active March 30, 2025 19:59
Split text file by filename/path comments (e.g. for writing LLM outputs to disk)
import sys
import os
from typing import Dict
import re
def parse_files(content: str) -> Dict[str, str]:
"""Parse the input content into a dictionary of filepath -> content."""
files = {}
maybe_files = set()
current_file = None