The tkinter entry box lets you input text in your desktop software. Usually an entry box (input field) comes with a label, that’s because without labels its not clear what the user should type there.

You can add more than one input field. The input field can show latin character but also other types of input (like passwords)

Related course:
Python Desktop Apps with Tkinter
icon

entry

tkinter entry

The tkinter entry box lets you type in the GUI. The code below adds an entry box to the GUI. The first parameter is what to add, the text parameter defines what to place next to it.

1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/python
# -*- coding: UTF-8 -*-

from tkinter import *

top = Tk()
L1 = Label(top, text="Label")
L1.pack(side=LEFT)
E1 = Entry(top, bd=5)
E1.pack(side=RIGHT)

top.mainloop()

tkinter entry

tkinter entry password

The tkinter entry can be plain text but it also supports password input. By changing the parameter show, you can make it look like anything you want.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import tkinter as tk

window = tk.Tk()
window.title('My Window')
window.geometry('500x300')

e1 = tk.Entry(window, show=None, font=('Arial', 14))
e2 = tk.Entry(window, show='*', font=('Arial', 14))
e1.pack()
e2.pack()

window.mainloop()

tkinter entry password