Login system, Notepad etc. open python idle or pycharm as python ide
and make a new file name main.py, Start typing
and make a new file name main.py, Start typing
from tkinter import* - "this import all tools from tkinter
root = Tk() - "root is the name Tk " *note always the first letter of Tk is capital
root.mainloop() - "type the name of tk+.mainloop(), mainloop() is used to run your application"
Setting the geometry or size of tkinter window -
TYPE
root.geometry("1000x500+0+0") - ("width" x "length" + "x position" + "y position")
Changing title of tkinter window - TYPE root.title("tkinter") -
("type your title here")
Using minsize and maxsize root.minisize(200,200) - ("width" ,"length") -this will setthe minimum size of window, windowsize dose not get smaller than thissize root.maxsize(1300,600) -("width" , "length") -this will set the maximum size ofwindow, window size dose not getlarger than this sizeMaking button Button name likebtn=Button(root,text="click") - Button thisis thinter function that define we are making a button (where you want to place,text is used to put text on button) and to see button in tkinter window we will to pack button there are two method to pack1. button name.pack() - btn.pack() 2. btn=Button(root,text="click").pack()
to be continued...(about tools)
Thanks 2 important information
ReplyDelete