for i in displayList:
print(i[0])
#loop through displayList
for i in range(0,len(displayList)):
#Test if the fist item in the current sub-list contains the text "Price Level
#Tip: Remeber that each sub-list is a (displayList). So you have
# to access its items via displayList followed by TWO indexes.
......
#Extract the second item from the currnet sub-list into variable called priceLevel
priceLevel = ...
#Test if priceLevel is between previousPrice and currentPrice OR
# priceLevel == previousPrice OR
# priceLevel == currentPrice
if....
:
#Sound the alarm. Pass in the frequency and duration.
if self.__currentPrice > self.__previousPrice:
frequency = 800
duration = 700
else:
frequency = 400
duration = 700
winsound.Beep(frequency, duration)
#Print the text 'Alarm' with a green background color, so that the user
#can go back and check when the alarm was sounded.
...
Comments
Leave a comment