I am trying figure out if I'm having an issue with my classes, or calling variables/lists from another function.
Below is a function I have being called from a button I press(inside a class that is my main window):
def analyzeRNA(self):
        self.p = self.textbox.get("1.0", END)
        protein_assignment(self.p)
        self.data = primary_structure
        self.databox.insert(END, self.data)
It reads from my textbox just fine. It performs my function protein_assignment on it and prints the results to the python shell as in the function does. It prints a list I make in protein_assignment that function called primary_structure. Now, how do put this information into my databox (which is also a "textbox" so to speak)
My error:
line 86, in analyzeRNA self.data = primary_structure
NameError: global name 'primary_structure' is not defined
Protein assignment outline:
def protein_assignment(sequence):
    x = 0
    primary_structure = []
    single_letter_assignment = []
    three_letter_code = []
    chemical_properties = []
    while True:
        blah, blah, blah adding amino acids to the list, running through sequence
        "if nothing else in sequence, print lists and break"
        return primary_structure #(Not sure if this is needed)
    return primary_structure #(Not sure what I'm doing here either)
If more is needed, glad to help. Running off to work right now. Will respond later. Please and thank you!
 
    