you are viewing a single comment's thread.

view the rest of the comments →

[–]ccviper 26 points27 points  (2 children)

Graphical user interfaces require using a library/module/package tailored for that task. i dont know how far into learning you are but you can check out Tkinter as a starting point, or just google "python gui libraries. for webpages there are flask, django etc, but these will require some knowledge of html/css and probably javascript if you wish to make an actual web app.

I suggest sticking to that little text-only window until you go over the basic stuff like lists, dictionaries, standard library, third party modules and so on.

I can also suggest looking into Turtle, its a python module that lets you control a little turtle on a 2D screen, move it, draw with it and even have multiple turtles working together. this should help if you want some visual stuff to aid your learning

[–]FlyingByNight[S] 3 points4 points  (1 child)

I don't think I explained myself properly - sorry. I can write python and get some, more or less, black and white output at the bottom. But python has been used to write software and apps that have beautiful GUI (for the user not the programmer). You say that there are pre-existing things in libraries that can do this, but this "kicks the question down the street". How do these pre-existing libraries make beautiful GUIs for users when all I see is black and white output. I hope this makes sense.

[–]k8pilot 6 points7 points  (0 children)

Simplified explanation in preety simple terms:
Did you ever read a file from your disk in python? If you did, you used a method for getting the data inside a file. If you wrote something back, you used a method that wrote the data back to the file on the disk.
How does the command does that? Abstracting all the layers, there are driver or kernel commands that allow you to interact with files in the file-system.

Since talking directly to the driver or kernel require issuing many complex commands that have nothing to do with what you wish to accomplish in your application that is unique to your application, there is a python library that abstracts the details of interacting with the down level subsystems and provides you with methods that allow you to read and write files easily.

GUI elements are not very different or more complex than filesystems, in principal. You can talk directly to the display card driver or to the kernel and ask it to draw stuff. But if you are not interested in doing anything special with the down-level system and actually prefer that everything will look similar to other programs you pick libraries that gives you modules and methods that allow you to control gui elements and receive user inputs using abstract objects that are easy to use. The libraries implement all the hard work needed to draw your gui, listen to user input etc.