用python读取股票价格_Python读取文件并给出股票价格
生活随笔
收集整理的這篇文章主要介紹了
用python读取股票价格_Python读取文件并给出股票价格
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
我使用的是ystockquote,可以找到here。基本上,我有一個包含我所有股票符號的文件,然后我用python將其筆下并顯示每只股票的價格。以下是我目前為止的代碼:import ystockquote
def intro():
# Here you enter the name of your file
watchlist = raw_input(">")
open_watchlist = open(watchlist)
print "What next"
next = raw_input(">")
if next == "view":
for line in open_watchlist:
quote = ystockquote.get_price(line)
print "%s: %s" % (line, quote)
intro()
這會產生以下錯誤:
^{pr2}$
有什么辦法讓它顯示符號和價格嗎?謝謝。在
總結
以上是生活随笔為你收集整理的用python读取股票价格_Python读取文件并给出股票价格的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: win10 如何锁定计算机,Win10
- 下一篇: centos7 修改为任意网卡名_cen