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

  • Home
  • SEARCH
  • 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 7965825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:15:32+00:00 2026-06-04T06:15:32+00:00

Widget tk.Entry from example_script.py do not save value ‘textvariable’ field. example_script.py: import Tkinter as

  • 0

Widget tk.Entry from example_script.py do not save value ‘textvariable’ field.

example_script.py:

import Tkinter as tk

class App(tk.Frame):
    def __init__(self, master, text):
        tk.Frame.__init__(self, master)
        textVar = tk.StringVar()
        textVar.set(text)
        entryVar = tk.Entry(self, textvariable=textVar).pack()
        self.pack()

def main():
    root = tk.Tk()
    text = ['text1', 'text2', 'text3']
    for i in text:
        App(root, i)
    root.mainloop()

main_script.py:

import Tkinter import example_script as ex

if __name__ == '__main__':
    root = Tkinter.Tk()
    Tkinter.Button(root, text='press', command=lambda: ex.main()).pack()
    root.mainloop()

If I change row ‘entryVar = tk.Entry(self, textvariable=textVar).pack()’ to

entryVar = tk.Entry(self)
entryVar.pack()
entryVar.insert(0, text)

field’s value is updated. Why?

How will be correct open new window from imported script? Tkinter.Toplevel() is not suitable. Now I use subprocess.Popen.

  • 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-04T06:15:33+00:00Added an answer on June 4, 2026 at 6:15 am

    You cannot create two instances of the Tk class in one program. Tkinter is not designed to work that way.

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

Sidebar

Related Questions

Playing around with Python - tkInter - Entry widget - when I use validatecommand
I am trying to make a program in Tkinter that requires the entry widget
This is the form: from django.forms.extras.widgets import SelectDateWidget class EntryForm(forms.ModelForm): class Meta(): model =
from Tkinter import * window = Tk() frame=Frame(window) frame.pack() text_area = Text(frame) text_area.pack() text1
With the following Tcl script, the entry widget will not accept input. It appears
I'm trying to make a widget used for controlled time entry that uses up
I have two widgets that can be checked, and a numeric entry field that
class Widget { public: Widget() { cout<<~Widget()<<endl; } ~Widget() { cout<<~Widget()<<endl; } void* operator
Is it possible to disallow free text entry in the JQuery UI autocomplete widget?
I found a fun autocomplete widget class on the internet--which I've stripped down to

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.