Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8154725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:27:10+00:00 2026-06-06T16:27:10+00:00

How would i go about setting up a Tkinter Text widget to do something

  • 0

How would i go about setting up a Tkinter Text widget to do something similar to IDLE’s entry? For example:

>>> Entry goes here!

However, i know how to insert them at the beginning of each line, but how would i go about making it non deletable, so that you cannot delete the >>>? I have searched around on google about this, but to no avail.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T16:27:11+00:00Added an answer on June 6, 2026 at 4:27 pm

    If the solution only has to be “Good Enough”, the technique I would use is this:

    1. When you insert the prompt, remember the index of the end of the prompt.
    2. Add a binding to the widget for the events you care about (eg: <BackSpace> and <Delete> and <<Cut>>)
    3. In this binding you can look at the index of the insertion cursor and selection, and if it’s prior to the saved index, ignore the event (ie: do a return "break").

    This should work more-or-less OK, though it allows you to insert characters prior to the prompt. Rewriting all the bindings that alter a text widget is a fairly daunting task, but just tracking deletes isn’t too hard.

    To solve the problem perfectly would require you write a little tcl code to intercept the low level insert and delete commands of the actual widget. It’s possible, though it requires a decent understanding of the underlying tcl code. For an example, see this answer: https://stackoverflow.com/a/11180132/7432

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm curious to know how I would go about setting up my service to
I needed to know how one would go about setting up a default avatar
I would like to know the best way to go about setting up a
Here's the address on my drive: C:\Program Files\Java\jdk1.6.0_18\bin How would I go about setting
How would I go about setting a link to perform certain functions like hide
I would like to know how I would go about altering the HTML that
Hay, i was wondering how i would go about setting up django so that
How would I go about setting up a PHP cron job in IIS?
I am wondering how I would go about correctly setting up a C++/CLI library
How would I go about setting the default font for all JLabel instances. Instead

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.