I have generated checkbutton from inputstatus dictionary to set as default values.After tht once it get display on GUI when i select it respected text and status will be added to new dictionary

    '''inputstatus = {
            'maggi': 1, \
            'pizza': 1, \
            'cold drinks': 1, \
            'fries': 1, \
            'chapati': 0, \
            'dip': 0
            }'''
        r=3
        cardtype = list(inputstatus)
        for ins in cardtype[:5]:
            print inputstatus[ins]
            if inputstatus[ins]== 1:
                chk_card = Checkbutton(self.frm1, text= ins, variable= inputstatus[ins])
                chk_card.select()
            else:
                chk_card = Checkbutton(self.frm1, text= ins, variable= inputstatus[ins])
                chk_card.deselect() 
            chk_card.grid(row=r,column=1)
            r=r+1

this code only displays checkbutton based on default status after selection of checkbutton i need new dictionary which have
current status of menu like " {'pizza':0,'chapati':1,....}"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.