I need to format my code in such a way that i can input a year and quarter number into my function below. The link has to be in byte format for later on in the code. The code itself comes from 2.7 which is why it is not working properly right now and gives the 'bytes' object has no attribute 'format' error. I know bytes do not have the .format attribute, but I have been unable to find another way to interpolate the function below. Can somebody help me?
def get_index(year, qtr, ftype):
url = b"https://www.sec.gov/Archives/edgar/full-index/{0}/QTR{1}/master.idx".format(year, qtr) #Master index from year and quarter