I am trying to find something similar to this https://caniwin.com/poker/omahahilopreALL.php for just for Omaha Hi. Does anyone know where I can find one? Or direct me to a python script to be able to print one?

I tried writing one, but my system crashes, and feel others have done this. Below is my script

from itertools import combinations
from phevaluator import evaluate_omaha_cards

def rank_omaha_hands():
    print("Ranking Omaha Starting Hands from Best to Worst:")

    deck = list(range(52))
    hands = []
    rank_count = 0

    for board in combinations(deck, 5):
        remaining_cards = set(deck) - set(board)
        for hand in combinations(remaining_cards, 4):
            rank = evaluate_omaha_cards(*board, *hand)
            hands.append((hand, rank))
            rank_count += 1

    hands.sort(key=lambda x: x[1], reverse=True)

    for i, (hand, rank) in enumerate(hands):
        card_names = [card_name(card) for card in hand]
        print(f"{i + 1}. Hand: {', '.join(card_names)}\tRank: {rank}")

    print(f"\nTotal number of evaluated hands: {rank_count}")

def card_name(card):
    ranks = "23456789TJQKA"
    suits = "cdhs"
    rank = ranks[card // 4]
    suit = suits[card % 4]
    return rank + suit

if __name__ == "__main__":

1 Answer 1


Figured it out by importing a high lo hand and exporting a script, here is the StackOverflow answer https://stackoverflow.com/a/76560792/4180276

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.