Page 498 - 3-2
P. 498
if hour == 0:
hour = 12
if now.tm_hour >= 12:
ampm = 'PM'
else:
ampm = 'AM'
week = ('Mon','Tue','Wed','Thu', 'Fri', 'Sat', 'Sun')
time_now = fontObj.render('%s' % (now.tm_year)+u' 년'+'%s' %(now.tm_mon)+u' 월
'+'%s'%(now.tm_mday)+u' 일 '+week[now.tm_wday],True, WHITE, BLACK)
time_now2=fontObj.render(ampm+' %s' % (hour)+' : '+ '%s' % (now.tm_min),True, WHITE, BLACK)
screen.blit(time_now, (480, 370))
screen.blit(time_now2, (650, 430))
pygame.display.flip()
# Audio recording parameters
RATE = 48000
CHUNK = int(RATE / 10) # 100ms
# The Speech API has a streaming limit of 60 seconds of audio*, so keep the
# connection alive for that long, plus some more to give the API time to figure
# out the transcription.
# * https://g.co/cloud/speech/limits#content
DEADLINE_SECS = 60 * 3 +5
SPEECH_SCOPE = 'https://www.googleapis.com/auth/cloud-platform'
API_Key = 'a84a0586ffdfea084ea879aaf5373997'
owm = OWM(API_Key)
City_ID = 1843564
obs = owm.weather_at_id(City_ID)
def make_channel(host, port):
"""Creates a secure channel with auth credentials from the environment."""
- 498 -