ahmedraza

index.py

Mar 12th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. #Iterrate over each element in symb
  2.         for share in symb:
  3.             #Get symbol of each element
  4.             symbol = share ["symbol"]
  5.             #Lookup current price of that specific symbol/sahre
  6.             quote = lookup (symbol)
  7.             #save each current price
  8.             for symbol in symb:
  9.                
  10.                 symb[symbol]['currentprice'] = quote ['price']
  11.                 symb[symbol]['total'] = quote ['price'] * share["shares"]
  12.            
  13.         #render values    
  14.         return render_template ("index.html", symbol = symb)
Add Comment
Please, Sign In to add comment