def the_message(y, x): the_time = float(y) * 60 firstscript.scroll_message_default( 'Reminder of {} set for {} minutes'.format(x, (int(y) * 60) / 60), 10) firstscript.clear_hat() while the_time > 60: time.sleep(60) the_time -= 60 time.sleep(the_time) firstscript.scroll_message_default(x)
def func(): now = datetime.now() current_time = now.strftime("%H:%M:%S") y = current_time.split(':') x = int(y[0]) if x < 12: current_time += ' AM' elif x == 12: current_time += ' PM' elif x > 12: x -= 12 current_time = '{}:{}:{} PM'.format(x, y[1], y[2]) scroll_message_default(current_time)
def blackjack(): cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] suits = ['diamond', 'clubs', 'spades', 'hearts'] firstscript.scroll_message_default('Are you ready to play blackjack? Y/N?', 40) x = input('') your_first_ace = False dealer_first_ace = False game_over = False your_total = 0 dealer_total = 0 if x.lower() == 'y': # play blackjack while not game_over: card = draw_card(cards) firstScript.scroll_message_default( 'Card is : {} of {} | Your total : {} | Dealer Total : {}'. format(card, random.choice(suits), your_total, dealer_total), 50) firstScript.scroll_message_default('Hit or Wait or Pass?', 50) else: firstscript.scroll_message_default('Type Y and hit ENTER to begin!', 50)
def main(): sense.scroll_message_default('Cameron Thacker') sense.clear_hat()
def run(): firstscript.scroll_message_default('Today\'s Weather Forecast ', 500) result = getcurrweather.run() firstscript.scroll_message_default('{} degrees Fahrenheit with {}'.format( result[0], result[1]))