January 27, 2005

Quine

Ok, so I was lured by another geeks web page to write my own quine in python. A quine is a program that outputs its own source code when you run it. So if you can also execute the output and still get the same thing.

Here is my python quine. It could be refactored to be smaller and more elegant but i'm a quine-building n00b and besides who can read that python code and make sense of it?

Here is how to make a really easy quine under linux:

$ touch myquine.sh
$ chmod +x myquine.sh
$ ./myquine.sh > my2ndQuine.sh

TADA!

Posted by darkarmani at January 27, 2005 09:02 PM
Comments

a='''def r():
print "a=%s%s%s"%("'"*3,a,"'"*3)
print "exec a"
r()'''
exec a

Posted by: David MacKay at December 9, 2005 03:39 PM

Cool site of course people!

Posted by: deneglka at January 8, 2006 10:31 PM

Cool site of course people!

Posted by: deneglka at January 11, 2006 09:22 AM

Cool site of course people!

Posted by: deneglka at January 14, 2006 12:52 AM

Cool site of course people!

Posted by: deneglka at January 19, 2006 10:49 AM

It's a very good site !

Posted by: viv at September 8, 2006 05:45 AM
Post a comment









Remember personal info?