コード例 #1
0
ファイル: HW3.py プロジェクト: rootulp/school
def updateArrow():
    for i in range (10000):
        windSpeed = bcWeather.getWindSpeed()
        windDirection = bcWeather.getWindDirection()
        print "Wind Speed:",float(windSpeed)        
        print "Wind Direction:",float(windDirection)
        world.clear()
        weatherArrow(windSpeed, windDirection)
        time.sleep(1)
コード例 #2
0
ファイル: HW3old.py プロジェクト: rootulp/school
def arrow():                                                        #function to draw arrow
        windSpeed = bcWeather.getWindSpeed()        #get wind speed & direction
        windDirection = bcWeather.getWindDirection()
        print "Wind Speed:",float(windSpeed)             #print wind speed & direction
        print "Wind Direction:",float(windDirection)
        lt(turt,90.0-windDirection)                             #orient turtle and draw arrow
        fd(turt,20.0+20.0*windSpeed)                                
        lt(turt,135)
        fd(turt,30)
        lt(turt,180)
        fd(turt,30)
        rt(turt,90)
        fd(turt,30)
        rt(turt,180)
        fd(turt,30)
        lt(turt, 135)
        fd(turt,20.0+20.0*windSpeed)
        lt(turt,90.0+windDirection)