Q:

Python 3.x - using text string as variable name

I'm trying to avoid to multiply functions in code by using  
def Return_Label(self,number)  

with a parameter. 
Any Idea how to use string in order to define variable name usable to .set value to StringVar()?
Example code below:
import tkinter as tk
from tkinter import *

class WINDOW():
    def __init__(self):
        self.Settings_Window()

    def Settings_Window(self):
        self.settings_window = tk.Tk()
        self.settings_window.minsize(200,200)
        self.entry = Entry(self.settings_window)
        self.entry.pack()
        self.entry2 = Entry(self.settings_window)
        self.entry2.pack()
        self.label1input = StringVar()
        self.label = Label(self.settings_window,textvariable=self.label1input, bg='yellow')
        self.label.pack(expand='yes',fill='x')
        self.label2input = StringVar()
        self.label2 = Label(self.settings_window, textvariable=self.label2input, bg='yellow')
        self.label2.pack(expand='yes', fill='x')
        self.button = Button(self.settings_window,text='SETUP1',command=self.Next)
        self.button.pack()
        self.button2 = Button(self.settings_window,text='SETUP2',command=self.Next2)
        self.button2.pack()
        self.settings_window.mainloop()

    def Next(self):
        self.number=1
        self.Return_Label(self.number)

    def Next2(self):
        self.number=2
        self.Return_Label(self.number)

    def Return_Label(self,number):
        self.entry_field_value = self.entry.get()
        print(self.entry_field_value)
        #self.label1input.set(self.entry_field_value)
        setattr(self,'label'+str(number)+'input.set',self.entry_field_value)

window=WINDOW()

A:

I prefer a list approach to managing multiple entry fields and updating values.
By using list you can use the index value to manage the labels as well :D.
See the below example of how you can use list to deal with all the values and updates.
import tkinter as tk
from tkinter import *

class Window(tk.Tk):
    def __init__(self):
        super().__init__()
        self.minsize(200, 200)
        self.entry_list = []
        self.label_list = []
        entry_count = 2

        for i in range(entry_count):
            self.entry_list.append(Entry(self))
            self.entry_list[i].pack()

        for i in range(entry_count):
            self.label_list.append(Label(self,bg='yellow'))
            self.label_list[i].pack(expand='yes', fill='x')

        Button(self, text='SETUP', command=self.Return_Label).pack()

    def Return_Label(self):
        for ndex, lbl in enumerate(self.label_list):
            lbl.config(text=self.entry_list[ndex].get())

if __name__ == '__main__':
    Window().mainloop()

