Python tkinter, restart the program
<p>this is simple example of my code:</p>

<pre><code>from tkinter import *
import random


class A:

    def __init__(self, master):
        n = random.randrange(1, 10, 1)
        self.frame_a = Frame(master)
        self.frame_a.pack()
        self.label_a = Label(self.frame_a, text=n)
        self.label_a.pack()

    def clean(self):
        self.frame_a.destroy()
        A(root)
        B(root)


class B:

    def __init__(self, master):
        self.frame_b = Frame(master)
        self.frame_b.pack()
        self.button_b = Button(self.frame_b, text='again', command=self.do_again)
        self.button_b.pack()

    def do_again(self):
        self.frame_b.destroy()
        hello.clean()


root = Tk()
hello = A(root)
world = B(root)
root.mainloop()
</code></pre>

<p>I want delete all frames and label and restart the program. But it doesn't work correctly. When I first time use button <code>again</code>, it works. However If I click button again, frame won't destroy.</p>

<p>EDIT:
This is sample of my code:</p>

<pre><code>class GamePick:

    def __init__(self):
        #there are also some labels and frames but they relate to my problem

    def do_black_jack(self):
        global bj
        global bj_play
        ''' You pick Black Jack, open new window and close actual window'''
        bj = Toplevel(self.master)
        bj_play = BjGui(bj)
        bj['bg'] = 'springgreen4'
        bj.wm_geometry("1500x900")
        Choices.close(my)

class BlackJack:

   #There are some function for pick new card for player and dealer

    def check_limit(self):#
        if sum(player_cards_val) &gt; 21:
            if 11 in player_cards_val:
                    player_cards_val.remove(11)
                    player_cards_val.append(1)
                    self.check_limit()
            else:
                    bj_play.show_result(res='Dealer win')
        elif sum(bot_cards_val) &gt; 21:
            if 11 in bot_cards_val:
                    bot_cards_val.remove(11)
                    bot_cards_val.append(1)
                    self.check_sixteen()
            else:
                    bj_play.show_result(res='Player win')
        else:
            if sum(player_cards_val) &gt; sum(bot_cards_val):
                    bj_play.show_result(res='Player win')
            else:
                    bj_play.show_result(res='Dealer win')



class BjGui:


    def __init__(self, master):
        self.master = master
        self.bot_frame = Frame(self.master, height=False, width=False, bg='springgreen4')
        bj.wm_geometry("1500x900")
        self.bot_frame.pack(side='top', pady=20)
        self.player_frame = Frame(self.master, height=False, width=False, bg='springgreen4')
        bj.wm_geometry("1500x900")
        self.player_frame.pack(side='bottom', pady=20)
        self.buttons_frame = Frame(self.master, bg='springgreen4')
        self.buttons_frame.pack(side=BOTTOM)
        # There are function for this class, they show players cards and bots cards from class Black Jack


    def show_result(self, res):#This function, create new label and button.
                               #  New label show result of the game, after I click button, it should will restart 
        self.info_label = Label(self.master, text=res, font=('aharoni', 60), bg='springgreen4', pady=35)
        self.info_label.pack()
        self.again_frame = Frame(self.master)
        self.again_frame.pack()
        self.again_bt = Button(self.again_frame, text='play again', font=('times', 12), command=self.do_again, bg='blue')
        self.again_bt.pack()

    def do_again(self):# This should delete all frames and clear list with cards and restart game, but it doesn't work
        self.info_label.destroy()
        self.again_frame.destroy()
        self.player_frame.destroy()
        self.bot_frame.destroy()
        self.buttons_frame.destroy()
        bot_cards_key.clear()
        bot_cards_val.clear()
        player_cards_key.clear()
        player_cards_val.clear()
        no_repeat.clear()
        BlackJack()
        BjGui(bj)
</code></pre>

<p>I would like to create Black Jack game. <code>class BlackJack</code> picks new cards for player and dealer, compare value of these cards, and determite who is winner. <code>class BjGui</code> shows players and dealers cards, there some buttons frames and labels. When the game ends, I use function <code>check_limit</code>, it determites who is winner and function <code>show_result</code> create new label with result and new button. This button should be able restart the game.</p>