Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
3

I accidently stumbled on a quine.

darkdarcool
darkdarcool

Hi!

So, while I was just messing around in python, I stumbled upon something that I actually kind hard to do. Which is make a quine.
I'll quickly sum up what a quine is. It is bassicly making a coding language print it's own source code. And is a lot harder than it sounds(seriously try one).

So, think it's kinda funny that I accidentally stumbled on one.

Here is the code

from sys import * def open_file(filename): data = open(filename, "r").read() print(data) def run(): data = open_file(argv[0]) run()

I put the repl under this, but you can copy paste the code above for yourself.

So, yeh. Short post. So uh. Bye?

2 years ago

Voters

Comments

TopNew
1
Michael8910
Michael8910

pretty cool. but what could be of its use

2 years ago
1
darkdarcool
darkdarcool

@MikeJMS8910

nothing, its useless, watch the art of code on youtube, they explain it better and show you more things you can do with it(everything is useless though), but you may learn something you didn't know before.

2 years ago
1
Michael8910
Michael8910

@darkdarcool
oh yea I was actually just starting to watch it

2 years ago
1
darkdarcool
darkdarcool

@MikeJMS8910

good, it's a super interesting video.

2 years ago
Load more