本文整理汇总了Python中astro_pi.AstroPi.load_image方法的典型用法代码示例。如果您正苦于以下问题:Python AstroPi.load_image方法的具体用法?Python AstroPi.load_image怎么用?Python AstroPi.load_image使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astro_pi.AstroPi
的用法示例。
在下文中一共展示了AstroPi.load_image方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AstroPi
# 需要导入模块: from astro_pi import AstroPi [as 别名]
# 或者: from astro_pi.AstroPi import load_image [as 别名]
#!/usr/bin/python
from astro_pi import AstroPi
ap = AstroPi()
ap.clear()
ap.load_image("space_invader.png")
示例2:
# 需要导入模块: from astro_pi import AstroPi [as 别名]
# 或者: from astro_pi.AstroPi import load_image [as 别名]
else:
ap.show_message("ISS is %sC warmer" % tempDiff,text_colour=[255, 0, 0]) #display the difference in red if ISS is warmer
ap.clear()
#compare the values and set the icon
if avRain < NoRain: #if there is no rain
if avCloud < valueSun: #if it is sunny
iconFileName = sunPng
elif valueSun >= avCloudArr < valueCloudSun: #if it is cloudy
iconFileName = cloudPng
else: #otherwise it is sunny/cloudy
iconFileName = suncloudPng
elif avRain <= LightRain: #if there is light rain
iconFileName = lightRainPng
else: #otherwise it is heavy rain
iconFileName = heavyRainPng
iconFileName= pngPath + iconFileName #add the correct icon file name onto the path to the icons folder
#display end icon
ap.show_message("Likely weather") #display the words 'Likely weather'
ap.load_image(iconFileName) #display the icon image
sleep(2) #keep displaying the image for 2 seconds
#say goodbye
ap.show_message(pickMessage(goodbyes)) #display a random goodbye message