4 ms·
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)
by peregrine 16y ago
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 16y agoLike 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? :)