A way to avoid repetitive codes tkinter
<p>I am trying to display images using tkinter. I notice that there are repetitive codes here. I am trying to get rid of these codes to display images. My goal is to display a number of images not in a discrete way but to display them dynamically in quantities.</p>

<p>please help thank you.</p>

<pre><code>    def __init__(self):
    Frame.__init__(self)
    self.master.title("Black Jack")
    blackjack = Blackjack()
    self.grid()

    self._playerCardImage = PhotoImage(file=str(blackjack._player._cards[0].fileName))
    self._playerCardLabel = Label(self, image = self._playerCardImage)
    self._playerCardLabel.grid(row=0, column=0)


    self._playerCardImage1 = PhotoImage(file=str(blackjack._player._cards[1].fileName))
    self._playerCardLabel1 = Label(self, image = self._playerCardImage1)
    self._playerCardLabel1.grid(row=0, column=1)

    self._dealerCardImage = PhotoImage(file=str(blackjack._dealer._cards[0].fileName))
    self._dealerCardLabel = Label(self, image = self._dealerCardImage)
    self._dealerCardLabel.grid(row=0, column=2)

    self._dealerCardImage1 = PhotoImage(file=str(blackjack._dealer._cards[1].fileName))
    self._dealerCardLabel1 = Label(self, image = self._dealerCardImage1)
    self._dealerCardLabel1.grid(row=0, column=3)
</code></pre>
