Q:

how i can assign the result of the entry textbox to a variable to then pass into a function in the backend?

I'm having some issues programming a hangman game using tkinter, with the front-end and back-end separated AND both using OOP (i understand using OOP in the backend wasn't really necessary and it probably would've been better as a library but I'm doing this as a learning exercise) . I'm new to tkinter and i was wondering how i can assign the result of the entry textbox to a variable to then pass into a function in the backend. I was also wondering if my self.letter_row and self.guesses_left labels would then be updated as they are updated in the backend, and though i have assigned them to the front at the initiation of game_gui(), i'm not sure if they'll do this automatically. Here's all the frontend code...
from tkinter import *
from tkinter.ttk import *
import hangmanSkeleton as hm

class game_gui():

    def __init__(self,master):
        self.master = master
        master.title("Hangman")

        this_game = hm.Hangman()

        self.word = this_game.word
        self.letter_row = this_game.letter_row
        self.letters_guessed = this_game.letters_guessed
        self.guesses_left = this_game.guesses_left
        self.letter = StringVar()

        self.lbl_word = Label(master, text = "Welcome to Hangman!")
        self.lbl_word.grid(row = 0,padx = 10 , pady = 15, columnspan = 2)

        self.lbl_row = Label(master, text = self.letter_row)
        self.lbl_row.grid(row = 1, column = 0, padx = 15, pady = 10)

        self.lbl_guesses = Label(master, text = "Guesses Left: " + str(self.guesses_left))
        self.lbl_guesses.grid(row = 1, column = 1, padx = 15, pady = 10)

        self.entry_letter= Entry(master, textvariable = self.letter)
        self.entry_letter.grid(row = 2, padx = 10, pady = 20, columnspan = 2)

        self.guess_button = Button(master, text = "Guess Letter", command=lambda: this_game.guess_letter(self.letter))
        self.guess_button.grid(row = 3, padx = 10, pady = 10, columnspan = 2) 

root = Tk()
gui = game_gui(root)
root.mainloop()

And here's just the function from the backend that I'm trying to get to work in self.guess_button() above..
def guess_letter(self, letter): 
    try: 
        if type(letter) != str or len(letter) != 1 or letter not in ascii_lowercase:
            raise TypeError
        if letter in self.letters_guessed:
            raise ValueError
        elif letter in self.word:
            for count in range (len(self.word)):
                if letter==self.word[count]:
                    self.letter_row = self.letter_row[0:count] + letter + self.letter_row[count+1:]
        else:
            pass
        self.guesses_left = self.guesses_left-1 #take one away from guesses
    except TypeError:
        print("Value given is not a letter")
    except ValueError:
        print("Letter has already been guessed")

thank you!

A:

Comment: I still can't get my labels self.letter_row and self.guesses_left to update though

Yes, these variables are not bound to the Label, i recommend using Label.configure(text=... instead.
Note: I show only .this_game.letter_row!
Add a function update_labels(... and .configure(... the Labels text:
def update_labels(self):
    self.lbl_row.configure(text=self.this_game.letter_row)
    # and so on

Call this function at last in .__init__(... and .guess_letter(....
The variable self.letter_row is not needed at all.

Question: how i can assign the result of the entry textbox to a variable to then pass into a function in the backend.

Change the following:

Make your variable this_game a member of class game_gui
self.this_game = hm.Hangman()

Add a helper method guess_letter(... to class game_gui.
Pass the letter to .this_game.guess_letter(....
Clear the letter from .letter.
def guess_letter(self, letter):
    self.this_game.guess_letter(letter.get())
    letter.set('')

Change the command, pointing to the helper method:
..., command=lambda: self.guess_letter(self.letter)

