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 6821583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:33:43+00:00 2026-05-26T21:33:43+00:00

here is some code: from Tkinter import * class Main(object): def __init__(self): self.console =

  • 0

here is some code:

from Tkinter import *

class Main(object):

    def __init__(self):
        self.console = Text(root, relief='groove', cursor='arrow', spacing1=3)
        self.console.insert(INSERT, '>>> ')
        self.console.focus_set()
        self.scroll = Scrollbar(root, cursor='arrow', command=self.console.yview)
        self.console.configure(yscrollcommand=self.scroll.set)

        self.scroll.pack(fill='y', side='right')
        self.console.pack(expand=True, fill='both')

root = Tk()
root.geometry('%sx%s+%s+%s' %(660, 400, 40, 40))
root.option_add('*font', ('Courier', 9, 'bold'))
root.resizable(0, 1)
app = Main()
root.mainloop()

is there some way to make ‘>>> ‘ become unremovable(like in IDLE for example)?
thanks in advance.

  • 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-05-26T21:33:44+00:00Added an answer on May 26, 2026 at 9:33 pm

    Take a look at IDLE’s source code. In particular look at ‘smart_backspace_event’ in EditorWindow.py. IDLE binds <Key-Backspace> on the text widget to this function (indirectly through the <<smart-backspace>> event).

    The basic code you’ll need follows like this:

    chars = console.get("insert linestart", "insert")
    # [Do some analysis on "chars" to detect >>> and prevent a backspace]
    
    if DO_BACKSPACE: 
        console.delete("insert-1c", "insert")
    
    # "break" is important so that the Text widget's backspace handler doesn't get called
    return "break"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is some code: class Person def initialize(age) @age = age end def age
Here's some code from Richard Jones' Blog : with gui.vertical: text = gui.label('hello!') items
I'm using some code from here to determine when determining when the last finger
I got some sample code from the net here: http://www.javadb.com/sending-a-post-request-with-parameters-from-a-java-class That works fine. It
I'm building a python application from some source code I've found Here I've managed
I am trying to get some form data from POST method. Here's the code
Here's some code: DirectorySearcher searcher = new DirectorySearcher(); searcher.Filter = (&(objectClass=user)(sAMAccountName= + lstUsers.SelectedItem.Text +
Here's some code from an FTP application I'm working on. The first method comes
Here is some code copied from Thinking in C++ Vol1 Chapter 10. #include <iostream>
For example, here is some code from django.templates.loader.app_directories.py.[1] try: yield safe_join(template_dir, template_name) except UnicodeDecodeError:

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.