Paint the Code
adelbordbari.github.io·2d·
Discuss: Hacker News
🏠IndieWeb
Preview
Report Post

At some point I fell (again) into the creative coding rabbit hole.

I re-read The Importance of Sketching with Code and it really clicked this time: instead of thinking “I need a big serious project”, just sketch. make tiny things. weird experiments. save them.

The result was this little side project: a Python source visualizer that turns any .py file into a panel of abstract rectangles. Nothing “useful”, but very fun.

So comments, strings, numbers, keywords, etc. all get their own “visual personality”.

In the end you get something that kind of looks like a Mondrian painting that’s been hit with a syntax highlighter.

def read_text(path):
"""Read the file as plain text, never executing it."""
wit...

Similar Posts

Loading similar posts...