There are only 126 possible 5-cards combinations for a 9-cards hand. So you can just iterate over them to find the highest. itertools.combinations(9_cards, 5)
can generate all of them.
To find the highest, a trivial implement could be define a function which gives a hand a score. Then use this function as key: max(all_5_cards_hands, key=hand_score)
You can use a tuple to represent the score. Leading by hand ranking and followed by card rankings.
An example:
STRAIGHT_FLUSH = 9
...
TWO_PAIR = 2
ONE_PAIR = 1
HIGH_CARD = 0
hand_score('A7532') # I omit suits here
# => (HIGH_CARD, 14,7,5,3,2)
hand_score('KK333')
# => (FULL_HOUSE, 3, 13)
hand_score('33444')
# => (FULL_HOUSE, 4, 3)
hand_score('AKQJ0')
# => (STRAIGHT, 14)
# Tuples can be easily compared:
(HIGH_CARD, 14,7,5,3,2) < (STRAIGHT, 14)
# => True