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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:42:54+00:00 2026-05-13T17:42:54+00:00

from Tkinter import * root = Tk() root.title(Whois Tool) text = Text() text1 =

  • 0
from Tkinter import *

root = Tk()
root.title("Whois Tool")

text = Text()
text1 = Text()

text1.config(width=15, height=1)
text1.pack()

def button1():
    text.insert(END, text1)

b = Button(root, text="Enter", width=10, height=2, command=button1)
b.pack()

scrollbar = Scrollbar(root)
scrollbar.pack(side=RIGHT, fill=Y)
text.config(width=60, height=15)
text.pack(side=LEFT, fill=Y)
scrollbar.config(command=text.yview)
text.config(yscrollcommand=scrollbar.set)

root.mainloop()

How can I add the data from a text widget to another text widget?

For example, I’m trying to insert the data in text1 to text, but it is not working.

  • 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-13T17:42:54+00:00Added an answer on May 13, 2026 at 5:42 pm

    You are trying to insert a Text reference at the end of another Text widget (does not make much sense), but what you actually want to do is to copy the contents of a Text widget to another:

    def button1():
        text.insert(INSERT, text1.get("1.0", "end-1c"))
    

    Not an intuitive way to do it in my opinion. "1.0" means line 1, column 0. Yes, the lines are 1-indexed and the columns are 0-indexed.


    Note that you may not want to import the entire Tkinter package, using from Tkinter import *. It will likely lead to confusion down the road. I would recommend using:

    import Tkinter
    text = Tkinter.Text()
    

    Another option is:

    import Tkinter as tk
    text = tk.Text()
    

    You can choose a short name (like "tk") of your choice. Regardless, you should stick to one import mechanism for the library.

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

Sidebar

Ask A Question

Stats

  • Questions 346k
  • Answers 346k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer No they are not included, you need to reference the… May 14, 2026 at 6:01 am
  • Editorial Team
    Editorial Team added an answer You can do it with the Refresh method on your… May 14, 2026 at 6:01 am
  • Editorial Team
    Editorial Team added an answer Looks like its crashing while trying to draw the UINavagationBar's… May 14, 2026 at 6:01 am

Related Questions

I want to spawn another process to display an error message asynchronously while the
I am making a small application with Tkinter. I would like to clean few
I've created this simple GUI: from tkinter import * root = Tk() def grabText(event):
I'm missing something about how sizes propagate in Tk. Try this: from Tkinter import
I was trying to write code that would auto-close a Toplevel Tk window in

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.