Answers for "py tkinter"

4

tkinter

from tkinter import * #import

def main():
  screen = Tk()#initialize
  screen.geomerty("num1xnum2") #pixels
  screen.title("Title")
  screen.cofigure(bg = 'grey')#hex colors or normal colors
  
  screen.mainloop()
main()#call
Posted by: Guest on June-28-2021
2

tkinter

from tkinter import *
from tkinter import ttk
root=Tk()
entry1=Entry(root,cursor="fleur",insertbackground="red")
entry1.pack()
Button(root,text="Get cursor type and colour", command=lambda: print(entry1['cursor'],entry1['insertbackground'])).pack()
root.mainloop()
Posted by: Guest on July-24-2021
13

tkinter python 3

import tkinter as tk

obj = tk.Tk() # Creates a tkinter object
label = tk.Label(obj, text="This is a text button")
Posted by: Guest on February-01-2020
0

python tkinter

import tkinter as tk #import the tkinter module as tk

core = tk.Tk() #makes the core (or root)
mylabel = tk.Label(core, text="Hello world!") #makes a label
mylabel.grid(row=0, column=1) #places the object in a virtual grid
                   
tk.Pack() #Pack the object(s)
core.mainloop()#Make the application a loop (needed)
Posted by: Guest on September-18-2021

Browse Popular Code Answers by Language