Entering Data in tkinter frames
<p>I'm writing a program to keep the score of a 14-1 billiard(pool) match. Since I needed multiple windows I used tkinter frames. The frames for 2 pages work with out difficulty. My problem is entering data. The first item to be entered in each players name. Both text boxes appear on the screen, and data can be entered. If I try to display the data after entering it I get nothing. I have been working on this for days. And I sure someone can look at it, and say hey knuckle head you did do this right. Would appropriate some help. </p>

<pre><code>import tkinter as tk
from tkinter import *


TITLE_FONT = ("Helvetica", 18, "bold")
TITLE_FONT_LINE2 = ("Helvetica", 14, "bold")

class SampleApp(tk.Tk):

    def __init__(self, *args, **kwargs):
        tk.Tk.__init__(self, *args, **kwargs)

        # the container is where we'll stack a bunch of frames
        # on top of each other, then the one we want visible
        # will be raised above the others

        container = tk.Frame(self)
        container.pack(side="top", fill="both", expand=True)
        container.grid_rowconfigure(0, weight=1)
        container.grid_columnconfigure(0, weight=1)

        self.frames = {}
        for F in (StartPage, PageOne, PageTwo):
            page_name = F.__name__
            frame = F(parent=container, controller=self)
            self.frames[page_name] = frame

            # put all of the pages in the same location;
            # the one on the top of the stacking order
            # will be the one that is visible.
            frame.grid(row=0, column=0, sticky="nsew")

        self.show_frame("StartPage")

    def show_frame(self, page_name):
        '''Show a frame for the given page name'''
        frame = self.frames[page_name]
        frame.tkraise()


class StartPage(tk.Frame):

    def __init__(self, parent, controller):

        player1 = StringVar()
        player2 = StringVar()
        game_balls = IntVar()


        tk.Frame.__init__(self, parent)
        self.controller = controller
        self.configure(background='green')
        self.controller.title('Billard Score Keeping')  
        label1 = tk.Label(self,text="This Program is for Scoring 14-1 Straight Pool", font=TITLE_FONT, bg = 'green')
        label1.pack()
        label = tk.Label(self, text="Championship 14-1 Match is 150 Balls", font=TITLE_FONT_LINE2, bg = 'green')
        label.pack()
        label2 = tk.Label(self,text="Player One Name ", font=TITLE_FONT_LINE2, bg = 'green').place(x=45,y=70)
        label3 = tk.Label(self,text='Player Two Name', font=TITLE_FONT_LINE2, bg = 'green').place(x=445,y=70)
        label4 = tk.Label(self,text='Enter Number of Balls in Match', font=TITLE_FONT_LINE2, bg = 'green').place(x=185,y=110)

        # Here is where I'm Having difficulty:

        self.entry = tk.Entry(self, text=player1, width=7, font=TITLE_FONT_LINE2).place(x=60,y=100)
        self.entry = tk.Entry(self,text=player2, width=7, font=TITLE_FONT_LINE2).place(x=480,y=100)
        self.entry = tk.Entry(self,text=game_balls, width=4, font=TITLE_FONT_LINE2).place(x=275,y=140)

        button1 = tk.Button(self, text="Go to Page One",
                            command=lambda: controller.show_frame("PageOne"))

        button2 = tk.Button(self, text="Go to Page Two",
                            command=lambda: controller.show_frame("PageTwo"))
        button1.place(x=275,y=440)
        button2.place(x=275,y=540)


class PageOne(tk.Frame):


    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        self.controller = controller
        self.controller.geometry('615x615+415+190')
        label = tk.Label(self, text="This is page 1", font=TITLE_FONT)
        label.pack(side="top", fill="x", pady=10)




        button = tk.Button(self, text="Go to the start page",
                           command=lambda: controller.show_frame("StartPage"))
        button.pack()


class PageTwo(tk.Frame):

    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        self.controller = controller
        label = tk.Label(self, text="This is page 2", font=TITLE_FONT)
        label.pack(side="top", fill="x", pady=10)
        button = tk.Button(self, text="Go to the start page",
                           command=lambda: controller.show_frame("StartPage"))
        button.pack()


if __name__ == "__main__":

    app = SampleApp()
    app.mainloop()
</code></pre>

<p>I can't see any attempt to access the contents of the text entry widgets. As such your code does exactly what I'd expect it to do.</p>

<p>If you want to read the contents of a text entry widget you should create a <code>StringVar</code> to hold the contents</p>

<pre><code>self.playerone = StringVar()
self.entry1 = ttk.Entry(parent, textvariable=playerone)
</code></pre>

<p>The content of the entry can then be read from the content of the <code>playerone</code> variable for example <code>playeronename = self.playerone.get()</code> (Of course the variable must use the fully qualified name with the namespace)</p>

<p>There is documenation on the entry widget at <a href="http://www.tkdocs.com/tutorial/widgets.html#entry" rel="nofollow">http://www.tkdocs.com/tutorial/widgets.html#entry</a> and <a href="http://effbot.org/tkinterbook/entry.htm" rel="nofollow">http://effbot.org/tkinterbook/entry.htm</a></p>

python tkinter