Skip to main content

Posts

Showing posts from May, 2022

how to put an image in the tkinter window

 Here in this blog we are going to make a window with the image attached in it. So this type of procedure is done by this coding which has been shown below:- from tkinter import * root = Tk () root . geometry ( "900x450" ) pici = PhotoImage ( file = "hit.png" ) pici_label = Label ( root , image = pici ) pici_label .image= pici pici_label . pack () root . mainloop () So this is the particularly attached file according to the coding means this is the hit.png

how to create a menu bar in Tkinter

 In this blog we are going to explain about the creating the menu bar in Tkinter  Here in the Image you can see that how the file ,edit and help menus are open there in the window so the same will happen in the codings below...... from tkinter import Toplevel , Button , Tk , Menu     top = Tk ()   menubar = Menu ( top )   file = Menu ( menubar , tearoff = 0 )   file . add_command ( label = "New" )   file . add_command ( label = "Open" )   file . add_command ( label = "Save" )   file . add_command ( label = "Save as..." )   file . add_command ( label = "Close" )     file . add_separator ()     file . add_command ( label = "Exit" , command = top . quit )     menubar . add_cascade ( label = "File" , menu = file )   edit = Menu ( menubar , tearoff = 0 )   edit . add_command ( label = "Undo" )     edit . add_separator ()     edit . add_command ( label = "Cut" )   ed...