home

Quine business cards

There are a great many creative business cards out there, in fact my brother, who is an electrical engineer, made a circuit board business card, that (when soldered with the right components) makes for an Arduino compatible, programmable prototyping board.

Since i’m not an electrical engineer, my own idea for a fun business card was to make the text on the card a functional software quine.1

Here is what i came up with:

"""
Samuel Burkhardt
samuel@burkhardt.dev
https://burkhardt.dev
"""

c = '"""%s"""\n\nc = %r\nprint(c %% (__doc__, c))'
print(c % (__doc__, c))

Thanks to pythons docstrings it’s pretty easy to include arbitrary text into the code.

I have not actually printed any of these business cards yet, since i haven’t had any need for business cards, but if i ever do, i’ll make sure to update this post with a photo.


  1. If you’re interested in quines that are a more substantial than what I presented, check out Yusuke Endoh on YouTube, they have uploaded an absolute treasure-trove of quines and other incredible programs on there.