Good evening everyone! I’m interested in how the print() function works at the hardware level. That is, a detailed process of how some text is displayed on the screen, for example "Hello, World! I run Python code with print("Hello, World!") in it, what happens next?
I’ve already searched the internet for an answer to this question. I couldn’t find any text that explained this. I’ve seen answers about printf() from the C language, but I’m interested in the Python language. I’ve also seen answers about how it works with functions inside it, but I’m interested in how it works with regular text output.
>Solution :
It prints to stdout which is one of two steams handled by the operating system ( the other one stderr is for errors).
The python interpreter which is written in C is the layer responsible for handling this. You should look at how streams as implemented in C to know how it is handled in a hardware level.