I read somewhere you could run python without an OS. How would I do this? Would I need to compile it? Can I run it raw? And if I did need to compile it, what tool would I use and what format would I compile it to?
-
6have a look at micropythonDerlin– Derlin2019-09-29 16:27:47 +00:00Commented Sep 29, 2019 at 16:27
-
Python has to run within an OS. Maybe you mean Python that is OS-independent? ISTR there was a python you caould install onto a USB stick and plug and playsnakecharmerb– snakecharmerb2019-09-29 16:27:53 +00:00Commented Sep 29, 2019 at 16:27
-
Yeah, how would os-independent python work? Could you please give me a link to an example? Does it have to go on a usb stick? And how would micropython work?Douglas– Douglas2019-10-03 10:28:39 +00:00Commented Oct 3, 2019 at 10:28
2 Answers
As far as I know there's not really any way to do this easily but I could be wrong. There are "portable" versions of python but these are operating system dependent. I think what you're referencing is some guys at PyCon managed to run python from the GRUB Bootloader. Your best bet would be installing some minimalist Linux distribution, with essentially only Python and some core packages required to run. The problem is that there's a lot of types of hardware out there, all with their own drivers and assembly language. Python can work as a low level language when you need it to but it seems like configuration would be a nightmare. I haven't looked into it super thoroughly but it seems difficult and impractical. Having an OS above python gives you access to the package managers IDEs and compilier options that make python worth using.
2 Comments
yea that's one of the options, pretty much all the "light" distros will be similar, if you want more to try out try here. Not sure why you're worried about speed though, if you're having speed issues it's far more likely to be the IDE you're using or your code bogging down the computer, not any sort of compiler issues.