views:

375

answers:

5

I was just wondering if it was possible to make an operating system in python. Nothing fancy. Maybe not even a "real" operating system with a kernel and all. Just a python program that is run when someone inserts the disc containing it that will make a fullscreen display on top of the installed os.

A: 

I guess, why would you think it isn't possible?

Josh K
+10  A: 

It sounds like what you want to write isn't an operating system, but a shell -- that is, it sounds like you want to write the functionality of a file manager and a desktop environment, and maybe launch other programs, but not bother with all the low-level stuff of drivers and I/O and whatnot.

If I'm interpreting your question right, then sure, it's possible! Some things that might prove useful:

  • For full-screen graphics, try pygame. Or, if you want it to look slightly more like a conventional system with premade buttons and windows and whatnot, try pygtk, where it's not too hard to make a window full-screen and you can go from there.

  • For things like digging around in the file system, investigate the os package.

Etaoin
That's sounds like exactly what I want. I want a program that looks and acts like a os but is actually just a python program running on top of a real os.
None
I have used pygame and like it very much so I would use it but there's no gui elements like buttons or textfields. I tried to install pygtk but it didn't work because it couldn't find the module dsextras. I am using a mac. I looked on google and it turned out other people had this problem. Is dsextras a module that doesn't exist in python for mac?
None
+5  A: 

http://www.dabeaz.com/coroutines ... pay close attention to Part 7. :-)

wescpy
+3  A: 

Yes, of course it is. Python is a Turing-complete programming language, which means that anything you can do in any programming language, you can also do in Python. Since OSs exist, you can obviously write them in some language, therefore you can write them in Python.

There actually used to be an OS written (largely) in Python, called Ununumium. They have long since shifted their focus away from being a Python OS and more towards interesting OS design concepts such as orthogonal persistence, and rewritten it in assembly.

Another Python OS which unfortunately hasn't seen any development in years is Cleese.

Jörg W Mittag
A: 

http://wiki.laptop.org/go/OLPC_Python_Environment

S.Lott
I don't think you even read the question.
Mike Daniels
@Mike Daniels: Interesting opinion. Any reason why you think that? Any advice on what's wrong with the answer? Any suggestion on how to fix it? Or just more downvotes?
S.Lott
Your answer appears to be an absolute non sequitur. Maybe if you added some explanation, it would not read as such. Besides, posting a single link with absolutely no other text is just about as lazy as you can get.
Mike Daniels
After some research it looks like you are referring to the Sugar desktop environment. ( http://en.wikipedia.org/wiki/Sugar_(desktop_environment) ) This is still irrelevant to the original question because Sugar is not an operating system but a desktop environment much like GNOME or KDE.
Mike Daniels
@Mike Daniels: Really. It totally takes over the desktop and runs OS-like applications. How is that *NOT* what the question is about?
S.Lott