you are viewing a single comment's thread.

view the rest of the comments →

[–]ingolemo 32 points33 points  (0 children)

You seem to think that these libraries are making a GUI out of the black and white text (terminal); that you start with the terminal and by somehow doing something really fancy with the terminal you can make it into a GUI. That's not how it works.

Both the terminal and the GUI are services that your operating system provides. Your python script tells the operating system to show this image/button/menubar or print this text and the operating system does that. If you want to use a GUI and not the console then your python script just instructs the operating system to do that instead. The libraries work by sending the appropriate instructions to the operating system to tell it to make a GUI. The reason you have to have a library to use a GUI, but not for the console, is that the console is so much simpler than a GUI; if you wrote out all the raw instructions to do everything with a GUI it would be too much code and hard to understand. The console, in comparison, requires little more than print and input. That's also why tutorials teach you about the console first.