Skip to content

Instantly share code, notes, and snippets.

View gvanrossum's full-sized avatar

Guido van Rossum gvanrossum

View GitHub Profile
def generate(source):
print("# What comes before")
print(f"{source.removesuffix(".py")}.c: $(srcdir)/{source}")
print("\t$(COMMAND)")
def generate_too(source):
print("# What comes before")
print(f"{source.removesuffix("some/bad-\"-stuff%!")}.c: $(srcdir)/{source}")
print("\t$(COMMAND)")
# Don't name this file html.py!
from __future__ import annotations
from typing import *
from dataclasses import dataclass
from html import escape
from html.parser import HTMLParser