I have the following code where I wanted the values of the selected checkboxes to be displayed. But the output is empty. rxList contains ['CAR1','CAR2','CAR3']
and I want to build checkboxes with these values and return the selected values. I am not getting why it is not reading the selected checkox values
Any suggestions are highly appreciated
def getSelections(rxList):
    window = Tk()
    global selections
    selections =[]
    for i in rxList:
        sel = StringVar()
        selections.append(sel)  
        cb = Checkbutton(window, text = i, variable = sel, onvalue = i, offvalue="None")
        cb.pack()
    btn = Button(window,text = "Next", command = showme)
    # btn1 = Button(window,text= )
    btn.pack()
    print(selections)
    window.mainloop()
def showme():
    for i in range(len(selections)):
        print("---selected values----",selections[i].get())
---EDIT----
I have one GUI already to select a XML file
BELOW IS MY CODE IN main_window.py.....
from tkinter import *
from tkinter import filedialog
from tkinter import messagebox
import path
from ARXML_Parser import importARXML
from pathlib import Path
import os
read_file_path =''
dest_file_path = ''
def select_file():
    global read_file_path
    global dest_file_path
    file_path = ""
    file_path = filedialog.askopenfilename(initialdir = "/",title = "Select file",filetypes = (("ARXML files","*.arxml"),))
    name = Path(file_path).stem #return the file name
    f_name = os.path.basename(file_path)
    nn = name + '.h'
    if file_path!="":
        file_name.configure(state = 'normal')
        file_name.delete('1.0',END)
        file_name.insert('1.0', file_path)
        file_name.configure(state = 'disabled')
        d_f_name = re.sub(f_name,nn,file_path) # from file path replaces XXXX.arxml with XXXX.h
        dest_file_name.configure(state = 'normal')
        dest_file_name.delete('1.0',END)
        dest_file_name.insert(END, d_f_name)
        dest_file_name.configure(state = 'disabled')
        read_file_path = file_path.strip()
        dest_file_path = dest_file_name.get('1.0',END).strip()
def select_folder():
    global dest_file_path
    chk = file_name.get('1.0',END).strip()
    print(f'chk---{chk}++')
    print(type(chk))
    if chk.strip() != '':
        folder_path = ""
        folder_path = filedialog.askdirectory()
        f_path = file_name.get('1.0',END)
        f_name = Path(f_path).stem + '.h'
        if folder_path!="":
            folder_path = folder_path + '/' + f_name
            dest_file_name.configure(state = 'normal')
            dest_file_name.delete('1.0',END)
            dest_file_name.insert(END, folder_path)
            dest_file_path = folder_path.strip()
            dest_file_name.configure(state = 'disabled')
    else:
        messagebox.showerror("Error", "You should select a file first.")
def call_func():
    if read_file_path =='':
        messagebox.showerror('Error','You need to select a file first before hitting convert button !')
    else:
        ret = importARXML(read_file_path,dest_file_path)
        if ret ==1:
            messagebox.showinfo('Message', 'The file got converted !')
            # root.destroy()
        else:
            messagebox.showinfo('Error', 'There seems to be error with file !')
            root.destroy()
def createCheckBox(rxList):
    var = StringVar()
    for i in rxList:
       c = Checkbutton(root, text = i, variable =  var)
       c.pack()
    return 1
root = Tk()
# root.resizable(False,False)x
root.title("ARXML Code Gen")
# root.geometry('2000x1000')
frame =  LabelFrame(root)
frame_Checkbuttons = LabelFrame(root)
scroll = Scrollbar(frame_Checkbuttons)
scroll.pack(side = RIGHT, fill = Y)  
dummy_text = Label(frame,text = "   ")
dummy_text1 = Label(frame,text = "\n ")
dummy_text1.grid(row=0, column = 1)
dummy_text1.grid(row=1, column = 2)
dummy_text.grid(row=2, column = 3)
select_file_button = Button(frame,text = "Select ARXML file", command = select_file)
select_file_button.grid(row =4, column=0,padx =25,pady=25)
file_name = Text(frame,height=2, width = 90)
file_name.grid(row = 4, column = 3,padx =10,pady=25)
dummy_text1.grid(row=5, column = 0)
dest_folder_button = Button(frame,text = "Destination Folder", command = select_folder)
dest_folder_button.grid(row = 6, column = 0, padx = 25,pady=10)
dest_file_name = Text(frame,height=2, width = 90)
dest_file_name.grid(row = 6, column = 3,padx =10,pady=10)
dummy_text.grid(row =7, column = 0)
submit_button =  Button(frame,text = 'Convert ARXML to .h ',width =20,height = 1,command = call_func)
submit_button.grid(row = 10, column = 3,sticky=N, columnspan=2,pady=10)
lumn = 0)
frame.pack(padx=20,pady=20)
frame_Checkbuttons.pack(padx=20,pady=20)
root.mainloop()
The below code is my parser code in ARXML_Parser.py....
from pathlib import Path
from tkinter import *
from xml.dom import minidom
from time import sleep
from temp import *
from tkinter import messagebox
def importARXML(src_path,dest_path):
    ARXML = minidom.parse(src_path.strip())
    dest_path = dest_path.strip()
    print(src_path.strip())
    ********** File is Parsed from source path ************
    ***************     some       ********************\
    *************   functionality       ******************
    **************      to get Rx   **********************8
    # so here is my Rx
    window = Tk()
    app = MainApplication(window,Rx)
And your code which you  sent me is stored in a file called temp.py.
is the problem because we have two mainloops ??
