Texas Holdem Poker Game I'm making a Texas Hold'em game for multiple players. So far, I have finished the flow control for betting / calling sequences, player stack / pot updating, and just now - the part responsible for drawing cards and distributing them. It is this last part that I would like reviewed, if possible.

Essentially, I wanted to know what I could do differently / more efficiently, suggested changes, really just anything that could be helpful. Things like checks for proper input from player etc are not yet in place so please ignore them.

import itertools
import random

player_count = int(input("How many players? "))

suits = ['s', 'c', 'd', 'h']
faces = ['A', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K']

# Defining deck and drawing cards (5 + 2 per player):

deck = set(itertools.product(faces, suits))
drawn_cards = random.sample(deck,(5 + 2 * player_count))

# Storing a list with player object instances

players = []

class Players:

    def __init__(self, stack):

        self.stack = stack
        self.last_action = "none"  ## last action taken (check, call etc). 
        self.street_bets = 0       ## total bets on current street

    def holecards(self):

## pop cards from list and pritifying their display. Cards will later be 
## run through a function for checking value of hands:

        card1 = drawn_cards.pop(len(drawn_cards)-1) 
        card2 = drawn_cards.pop(len(drawn_cards)-1) 
        self.card1 = (card1[0]+"["+card1[1]+"]")    
        self.card2 = (card2[0]+"["+card2[1]+"]")     
        self.cards = self.card1+ " - " +self.card2
        print (self.cards)      

class Table:

    def __init__(self):     

        self.total_pot = 0

    def flop(self):

        card1 = drawn_cards.pop(len(drawn_cards)-1)
        card2 = drawn_cards.pop(len(drawn_cards)-1) 
        card2 = drawn_cards.pop(len(drawn_cards)-1)
        self.card1 = (card1[0]+"["+card1[1]+"]")
        self.card2 = (card2[0]+"["+card2[1]+"]")     
        self.card3 = (card2[0]+"["+card2[1]+"]")
        self.flop = self.card1+ " - " + self.card2 + " - " + self.card3
        print (self.flop)

    def turn(self):

        card = drawn_cards.pop(len(drawn_cards)-1)
        self.card = (card[0]+"["+card[1]+"]")
        self.turn = self.card
        print (self.turn)

    def river(self):

        card = drawn_cards.pop(len(drawn_cards)-1)
        self.card = (card[0]+"["+card[1]+"]")
        self.river = self.card
        print (self.river)



# Add player stacks and distribute holecards:

for i in range(player_count):
    players.append(i)
    players[i] = Players(100)
    players[i].holecards()

# Add dealer to table:

dealer = Table()

dealer.flop()
dealer.turn()
dealer.river()
Reasonable quality code. Here are a few comments:

1) I'd add a method drawNextCard, which encapsulates retrieval of the next card, and makes the code a bit more readable

def draw_next_card(drawn_cards):
    card = drawn_cards.pop(len(drawn_cards)-1)
    return readable_card_name(card)

def readable_card_name(short_card_name):
    return (short_card_name[0]+"["+short_card_name[1]+"]")


Then, for example, your flop() method would look like this:

def flop(self):
    (self.card1, self.card2, self.card3) = (draw_next_card(drawn_cards), draw_next_card(drawn_cards), draw_next_card(drawn_cards)) 
     self.flop = self.card1+ " - " + self.card2 + " - " + self.card3
     print (self.flop)


More readable, shorter, and on the way we fixed a copy/paste defect where you initialized card2 twice instead of card2 and card3.

2) You convert each drawn card to a readable representation. It's good for your debugging, but not so good for adding future functionality for actually calculating poker hands, and developing strategy. So, while my draw_next_card above returns a readable representation, you're better off creating a class Card, which has an __str__ method that has the same implementation as readable_class_name. The flop method would remain the same, but it will be much easier to extend the code.

3) Note that flop and river are copy/pastes. Both could just call draw_next_card. Also, while the flow and river are true to the game terms, they're not much benefit to software; you'd be better off collapsing flop, turn and river to a table_cards[5] vector. Once you start developing the actual game, it will make things much easier for you.

Hope this helps.