Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to add input box in tkinter

from tkinter import *

window = Tk()
# entry box
my_input = Entry()
my_input.pack()

window.mainloop()
Comment

tkinter input box

import tkinter as tk

root= tk.Tk()

canvas1 = tk.Canvas(root, width = 400, height = 300)
canvas1.pack()

entry1 = tk.Entry (root) 
canvas1.create_window(200, 140, window=entry1)

def getSquareRoot ():  
    x1 = entry1.get()
    
    label1 = tk.Label(root, text= float(x1)**0.5)
    canvas1.create_window(200, 230, window=label1)
    
button1 = tk.Button(text='Get the Square Root', command=getSquareRoot)
canvas1.create_window(200, 180, window=button1)

root.mainloop()
Comment

PREVIOUS NEXT
Code Example
Python :: get median of column pandas 
Python :: print time python 
Python :: django rest framework configuration 
Python :: how to dynamically access class properties in python 
Python :: random .randint renpy 
Python :: stop a function from continuing when a condition is met python 
Python :: how to play a mp3 file in python 
Python :: python method to filter vowels in a string 
Python :: clear console in python 
Python :: how to check if an element is visible on the web page in selenium python 
Python :: how to find the neighbors of an element in matrix python 
Python :: print key of dictionary python 
Python :: how to enable matplotlib in notebook 
Python :: cv2 resize 
Python :: rolling average df 
Python :: python sort with comparator 
Python :: UnicodeDecodeError ‘utf8’ codec can’t decode byte pandas 
Python :: stringf replcae in python 
Python :: jupyter no output cell 
Python :: skip header in csv python 
Python :: pandas dataframe hist title 
Python :: django import settings 
Python :: how to create file using python cat command 
Python :: How do you create and update One2Many and Many2Many records with Python 3? 
Python :: how to add subtitle matplotlib 
Python :: virtual env in mac 
Python :: install decouple python 
Python :: insert QlineEdit into QMenu python 
Python :: df reanme columns 
Python :: python elementtree build xml 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =