>>> python -c "from pyalgotrade.tools import yahoofinance; yahoofinance.download_daily_bars('orcl', 2000, 'orcl-2000.csv')"
SyntaxError: invalid syntax
You should be entering this at the shell console, not from within Python. At the shell:
dsm@winter:~/coding$ python -c "from pyalgotrade.tools import yahoofinance; yahoofinance.download_daily_bars('orcl', 2000, 'orcl-2000.csv')"
dsm@winter:~/coding$ wc orcl-2000.csv
253 254 12694 orcl-2000.csv
The python -c
part means "start up Python, and feed it the following string to execute".
Alternatively, you could do it within Python:
>>> from pyalgotrade.tools import yahoofinance
>>> yahoofinance.download_daily_bars('orcl', 2000, 'orcl-2000.csv')