完整代码
from matplotlib.finance import _quotes_historical_yahoo
from datetime import date
import pandas as pd
def search(name):
today=date.today()
start=(today.year,today.month-1,today.day)
quotes=_quotes_historical_yahoo(name,start,today)
df=pd.DataFrame(quotes)
print(df)
def getName():
str=input("input the name of stock\n")
return str
str=getName()
search(str)
下图是查询苹果的最近一个月的股票信息
Comments NOTHING