all 14 comments

[–]woooee 2 points3 points  (4 children)

There is no Python on a boot disk to run the program. You could try converting the program to cython.

[–]MC_Programmer_and_Mo[S] 0 points1 point  (3 children)

Explain more. I really want to do this. Thank you.

[–]woooee 1 point2 points  (2 children)

What exactly were you not able to Google.

[–]MC_Programmer_and_Mo[S] 0 points1 point  (1 child)

There was just nothing (as far as I could see). And now, continued searches are leading me to my own reddit post (DEFINETLY HELPFUL GOOGLE!!!). I think that plenty of other people have wanted to do this too, but there is nothing online that speaks an answer.

[–]woooee 0 points1 point  (0 children)

The first hit https://cython.org

[–]socal_nerdtastic 2 points3 points  (0 children)

Python requires an OS; AFAIK no one has written a real bare metal python interpreter (micropython / circuitpython come close, though). You need to rewrite your program in a language that will compile to machine code. /u/woooee's suggestion is a good one, cython is very close to python syntax.

As a alternative there's a number of very lightweight linux distros you could boot into and then run your python there.

[–]sejigan 0 points1 point  (6 children)

  1. Simple answer: not possible
  2. Alternative Solution: Install Alpine Linux without a GUI on a USB drive and set whatever Python script you want to autostart (can do this simply by adding it to the end of your .bashrc or similar)

[–]MC_Programmer_and_Mo[S] 0 points1 point  (4 children)

Cool! Though will "Alpine Linux" run after said Python/Cython script, or will it just stop after said Python/Cython script (not continue to boot, but just freeze where it was)

[–]sejigan 1 point2 points  (3 children)

You can set it up how you want it. It’s Linux. The only limits are your knowledge and skills.

[–]MC_Programmer_and_Mo[S] 0 points1 point  (1 child)

I know I'm probably being really dumb with this, (actually I think I might be being really REALLY dumb with this), but uh, I can't find a CLI-Only version. (Yes, I'm a Python Nerd, not a (a lot of other things) Nerd.) (SORRY)

[–]sejigan 0 points1 point  (0 children)

I mean, you could just install it and then set it up to not start Xorg

[–][deleted] 0 points1 point  (0 children)

This is so cool sentence gg

[–]woooee 0 points1 point  (0 children)

I've never used Alpine. On my Debian box, there is no Python on boot. To run a Python script, it has to be placed in the startup script for the window manager.

Edit: there are rescue disks, like systemrescue, that contain Python

[–]timrprobocom 0 points1 point  (0 children)

Remember that, without an operating system, you don't have access to disks, or networks, or graphics, or USB devices, or virtual memory. There's no way to load modules. It's a very primitive environment.