def format_yahoo_index_url(symbol, start_date, end_date):
 return ('http://ichart.finance.yahoo.com/table.csv?' + urlencode({'s': symbol, 'a': (start_date.month - 1), 'b': start_date.day, 'c': start_date.year, 'd': (end_date.month - 1), 'e': end_date.day, 'f': end_date.year, 'g': 'd'}))

def format_yahoo_index_url ( symbol , start_date , end_date ) : return ( 'http://ichart.finance.yahoo.com/table.csv?' + urlencode ( { 's' : symbol , 'a' : ( start_date . month - 1 ) , 'b' : start_date . day , 'c' : start_date . year , 'd' : ( end_date . month - 1 ) , 'e' : end_date . day , 'f' : end_date . year , 'g' : 'd' } ) )
format a url for querying yahoo finance for index data .