Tkinter is the standard GUI library in the python release version. That is to say, tkinter can be used after python is installed by default.
I have referenced a tutorial and wrote someCodeTry:
# File: test. pyfrom tkinter import * class app: def _ init _ (self, Master): Self. frame = frame (master) self. frame. pack () self. button = button (self. frame, text = 'quit', fg = 'red', command = self. frame. quit) self. button. pack (side = left) self. hi = button (self. frame, text = 'hello', command = self. hi) self. hi. pack (side = left) def HI (Self): Label = label (self. frame, text = 'hello, python! ') Label. Pack () root = TK () root. wm_title ('hello') root. wm_minsize (300,250) APP = app (Root) root. mainloop ()
It can be run, but the annoying thing is that there is always a command line interface after the graphical interface (in windows, click test. py, as shown in the result ):
... After a while, I changed the file name to test. pyw and OK. There is no command line:
This is the case !!! Continue my python journey...