Paint the Code
adelbordbari.github.io·9w·
Discuss: Hacker News

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...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help