23 points · by orph4nus · 10y ago · 12 comments
It feels like cheating, but it's also probably the easiest way to get a true quine which'll always work even if you modify parts of the code (while retaining the part of the program which ingests and prints out the file's contents).
A proper quine, though, doesn't require input.
#!/usr/bin/env python2.7
print open(__file__, 'r').read()
Seems like cheating!