How can I directly access the color of pixels and create windows in Python? I have found ways like Pillow and Turtle, but what are they built on? And what are the ones supporting them built on? I am looking for the most native and basic way to render pixels.
If this is not specific enough, then how can I directly make a window of size 100x100 and coordinates (0,0) on the screen and make a red box of size 10x10 in the middle of the screen and then clear the window and redraw the box 5 pixels to the right? I want to all of this without using a library to make it easier. Hopefully it is in a way where I could write my own library.
In turtle, the first render might look like this:
import turtle
turtle.hideturtle()
turtle.speed(0)
turtle.setpos(-5,-5)
turtle.setheading(90)
turtle.pencolor("red")
turtle.pensize(1)
turtle.pendown()
for _ in range(5):
turtle.forward(10)
turtle.right(90)
turtle.forward(1)
turtle.right(90)
turtle.forward(10)
turtle.left(90)
turtle.forward(1)
turtle.left(90)