vendredi 6 mars 2015

How can i provide a user input and an if statement in python

i am making a something on the raspberry pi that will give you stock prices. here is the code:



import ystockquote
tickerSymbol = 'ADSK'
allInfo = ystockquote.get_all(tickerSymbol)
print tickerSymbol + " Price = " + allInfo["price"]


I first had to download ystockquote on the pi to get the stockquotes from yahoo finance. The tickerSymbol is where you type in the company's name(abbreviation, ADSK is autodesk). what i want to do is manually type in the company abbreviation and then it will provide the price. i have tried things that i thought would work. not the experienced though with python than i am with c++.


Aucun commentaire:

Enregistrer un commentaire