Set default cursor position inside entry widget in Tkinter Python
问题 I want to set the default cursor location inside the entry widget when I run the program. So when I run it I don't have to click inside the widget to start typing. Can anyone help me with this? Actually I'm new at programming import tkinter as tk root = tk.Tk() e = tk.Entry(root) e.pack() tk.mainloop() 回答1: Simply call the focus method for the widget: import tkinter as tk root = tk.Tk() e = tk.Entry(root) e.pack() e.focus() tk.mainloop() 来源: https://stackoverflow.com/questions/59499960/set