23

screenshot of my app

Here is a screenshot of a program I am writing using Python Tkinter. I use ttk.Entry widget to get the user input.

I would like to know how to center the input in the Entry (as you can see, the input is now stuck to the left part of the widget)

FabienAndre
  • 4,514
  • 25
  • 38
user12345
  • 407
  • 1
  • 3
  • 10

1 Answers1

56

Entry widgets take the option justify, which for centered text should be 'center'. When creating the widget, do something like

e = ttk.Entry(master, ..., justify='center')
Abe Karplus
  • 8,350
  • 2
  • 27
  • 24