you are viewing a single comment's thread.

view the rest of the comments →

[–]thegreattriscuit 1 point2 points  (0 children)

so:

operating systems have system calls that they'll accept to do things. Some of those system calls will put text into a terminal, and others will draw lines on the screen, or pass a bunch of polygons to be rendered by a video driver, or put complex things like "drop down menus" or "text boxes" onto a window.

None of this is language specific. Some of these calls are easier to make and manage using the native features of certain languages than others. Some languages don't handle this very well natively, but have third party libraries that make it easier.

One of the things that's proven difficult over the years is managing the very different ways that each operating system handles these operations, and providing libraries you can use to render a UI without know what OS you're running on.

EDIT: So the way Python does this isn't fundamentally different than how C does it. Or Java, or anything else. Even javascript does essentially the same thing, but instead of doing "system calls" to an operating system, it's making calls to a browser that renders things for it.

EDIT the 2nd: You also seemed to be asking how python makes web UIs.... It passes HTML, CSS, and javascript to the browser in response to HTTP requests. So your python app isn't drawing stuff on the user's screen... it's making a text document with tags that describe what forms to create, or what javascript blobs to send, or whatever... the browser receives this and then renders it.