Share your repls and programming experiences

← Back to all posts
Simple OS: A simple OS!
[deleted]

Simple OS is a operating system made in python binary. I call it simple because it is made of just 7024 1's and 0's. This OS is all text based. Here are the basic commands. "start file_name" runs a python file. "new file_name" creates a new file. "read file_name" reads a file. "del file_name" deletes a file. "app calc" runs the calculator. "download url" downloads a file off the internet by url. Edit: To read some memes type "download https://memes.MarkRatcliffe.repl.co" then save as meme.txt. Afterwards you can read them memes!

Voters
ArmanS3
JacobMacLeod
HYPR
mkhoi
bossotron13
matsogeum8
mathmaniac88
TST2024
thomasgardner20
Teamcrohn
Comments
hotnewtop
sugarfi

Instead of just typing out '1' and '0', most binary programs convert each byte, or 8 bits, into a character. For example, instead of writing '1000001', you would write 'A'.

ChungusFam

That is interesting to [email protected]

TST2024

Can I just say amazing I don't know how people code in binary it seems like it would take forever.

[deleted]

@TST2024 Thanks. Also yeah, binary does take forever to code.

Vandesm14

@MarkRatcliffe Please don't lie that you "coded in binary". This isn't truly an OS nor is it truly binary (machine) code. All you did was convert a python script into binary (from text) and convert the binary back to text on run. You then just run the code. I will say, I like the idea, but it is false advertising to say that you made an "operating system in binary".

sycrepl

@Vandesm14 just checked and yeah, he even commented lol

[deleted]

@Vandesm14 Oh sorry, I did not make it to be like that. I fixed the post.

JacobMacLeod

This is so cool! I love it!

prushton

I tried to open a file that didnt exist and got an error. I would make a case to handle that and not kill the program

HENRYMARTIN4

This is what he actually wrote:

from requests import get # to make GET request

def download(url, file_name):

print('Welcome to Simple OS')
def run(runfile):
with open(runfile,"r") as rnf:
exec(rnf.read())
while(1 == 1):
code = input('> ')
if "start " in code:
code = code.replace("start ","")
run(code)
if "new " in code:
code = code.replace("new ","")
content = input("File Content: ")
f = open(code, "w")
f.write(content)
f.close()
if "read " in code:
code = code.replace("read ","")
f = open(code, "r")
print(f.read())
if "app calc" in code:
print(eval(input("Calculation: ")))
if "del " in code:
code = code.replace("del ","")
import os
os.remove(code)
if "download " in code:
code = code.replace("download ","")
name = input("File name: ")
download(code,name)

[deleted]

@HENRYMARTIN4 Yeah. It is pretty simple. I wrote the python using binary characters. I did all of that manually

HENRYMARTIN4

@MarkRatcliffe Oh. I assumed you used a simple binary translator.

Coder100

Nice work! I would do this in python, but binary seems more appropriate:

Translation:

mathmaniac88

where did u learn to code binary can u give me a link or something. Thx!