Python Forum

Full Version: Line Index
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to get index of Line number where the cusror is present? I am using bind to call a function, i need to pass the function the index of the line
If you are referring to a text widget, use:

cursorpos = text_widget_name.index(INSERT)
replace text_widget_name with real text widget name