抽奖小程序

import random
import keyboard
import time


def make_choice():
    while True:
        choice_selected = random.choices(['乾', '坤', '坎', '离', '兑', '震', '巽', '艮'])[0]
        print(choice_selected, end='\r')
        # time.sleep(0.1)
        if keyboard.is_pressed('enter'):
            return choice_selected


if __name__ == '__main__':
    print("抽奖开始!!!")
    choice_selected = make_choice()
    print('选项是:', choice_selected)
    print("搞起来吧,骚年!!!!!!")

你可能感兴趣的:(抽奖小程序)