
How To Write A Quine - chaosmachine
http://www.madore.org/~david/computers/quine.html
======
peregrine
Couldn't you write a program that loads its own file and prints out each line

    
    
      __main__():
        prgm = file("prgm.py")
        for line in prgm:
           print(line)
    

or does that break the rules?

~~~
Irfaan
Like you surmised - that breaks the rules.

And since a quine is generally "just" a brain-teaser rather then a useful tool
- where's the fun in breaking the rules? :)

~~~
gcr

        File "pyquine.py", line 1
          File "pyquine.py", line 1
          ^
      IndentationError: unexpected indent
    

I did not write this quine.

~~~
eru
In Python the empty file is also a Quine.

