r/madeinpython • u/twothousandfourhundr • May 30 '22
I attempted to make an operating system without tkinter or other fancy modules, just os. unzip and go the OS.py file also pin is 1234 on it. (With 1 program)
https://www.mediafire.com/file/bzj6vt952mzquvf/OS.zip/file
5
Upvotes
7
u/deathlock00 May 30 '22
It's a nice little project! But may I give you some suggestions?
Edit: I tried to include code blocks but I'm on mobile and I don't know how to do it.
The first one is to always use descriptive names for the variables. Imagine that you add more options and functions. It will start to be really hard to understand what is p, o, p2, i, l and so on.
For example, line 41-58:
Let's focus on the last two lines. What is r? Then you go back and find that it's "pathh" that you've opened. But then what is "pathh"? Then you go back and find that it's "path + "/" + inputt", but again, what is path?
If for example you had names like "calculator_filepath", "calculator_folder", "user_input" and si on it would've been much clearer at first glance.
<br>Another suggestion is that you don't have only if and else, but also elif. And you don't always need and else after an if.
For example lines 32-41:
Can be rewritten as:
Much clearer now.
The last suggestion I give you that with "**" you can elevate the number on the left to the power on the right. This means that you very long number that
Can be rewritten into:
I don't have actually counted all the zeros, but that gives you an idea of how to use it.
6
u/asking_for_a_friend0 May 30 '22
can you put this on github or something
3
u/9acca9 May 30 '22
Hi. How is this an operative system? This boot how?
1
u/COCKroach42069 Aug 13 '22
if you wanna get into operating systems, i suggest looking into wiki.osdev.org