Re: Generator - Provide parameters to url - requests

2017-07-05 Thread Peter Otten
Sayth Renshaw wrote: > Thanks. > > I left "base" out as i was trying to remove as much uneeded code from > example as possible. I had defined it as > > base = datetime.datetime(2017,1,1) You actually did provide that line in your post. > Reading your code this sounds to simple :-). > > def da

Re: Generator - Provide parameters to url - requests

2017-07-05 Thread Sayth Renshaw
Thanks. I left "base" out as i was trying to remove as much uneeded code from example as possible. I had defined it as base = datetime.datetime(2017,1,1) Reading your code this sounds to simple :-). def dates(first, numdays): # generate datetime objects for extra clarity # note ther

Re: Generator - Provide parameters to url - requests

2017-07-05 Thread Frank Millman
"Sayth Renshaw" wrote in message news:328f42bb-ba23-4199-9f3a-9ec1829bc...@googlegroups.com... Hi I am struggling to figure out how I can create a generator to provide values to my url. My url needs to insert the year month and day in the url not as params to the url. import json import re

Re: Generator - Provide parameters to url - requests

2017-07-05 Thread Peter Otten
Sayth Renshaw wrote: > Hi > > I am struggling to figure out how I can create a generator to provide > values to my url. My url needs to insert the year month and day in the url > not as params to the url. > > > import json > import requests > import datetime > > # using this I can create a lis

Generator - Provide parameters to url - requests

2017-07-04 Thread Sayth Renshaw
Hi I am struggling to figure out how I can create a generator to provide values to my url. My url needs to insert the year month and day in the url not as params to the url. import json import requests import datetime # using this I can create a list of dates for the first 210 days of this ye