function returns tuple with nothing in it
Question: 
    #!/usr/bin/python3.5
    
    import os, sys
    
    from time import strftime
    from os.path import join
    
    path = '/home/william/.btrfs-snapshots/'
    age = 24
    todaytuple = (int(strftime("%y")),int(strftime("%m"))int(strftime("%d")))
    
    
    
    def get_date_tuple(filename):
        numberstr = ('1', '2', '3', '4', '5', '6', '7', '8', '9', '0')
        filename = ''
        datelist = []
        global datepart
        datepart = ''
    
    
        for i in filename:
            for n in numberstr:
                if i == n:
                    datepart += i
                    if len(datepart) == 2:
                        y = int(datepart)
                        datelist.append(y)
                        datepart = ''
                else:
                    pass
        snapshotbirthtuple = tuple(datelist)
        return snapshotbirthtuple
    
    
    for fname in os.listdir(path):
        snapshotbirthtupleinscope = get_date_tuple(fname)
        print(snapshotbirthtupleinscope)
        if snapshotbirthtupleinscope[0] <= todaytuple[0]:
    

`print(snapshotbirthtupleinscope)` prints `()` just empty parentheses, i'm
expecting a tuple of pairs of numbers. i'm fairly certain that the function
gives the right output, but i think i might not be passing the return variable
correctly from the function.

    
    
    () #the tuple returning nothing
    Traceback (most recent call last):
      File "./snapshotfinal.py", line 38, in <module>
        if snapshotbirthtupleinscope[0] <= todaytuple[0]:
    IndexError: tuple index out of range
    

why is snapshotbirthtupleinscope != snapshotbirthtuple?


Answer: It looks like your could use some work. First based on your variable names,
you will want to assign something to filename for example:

    
    
    filename = r"C:\MyFile.txt"
    

Once you have that, you will want to open the file and parse its contents:

    
    
     with open( filename, "r") as fp:
            data = fp.read()
            # Process Data In File where datelist is set
     # end with automatically closes file for you
    
     snapshotbirthtuple = tuple(datelist)
     return snapshotbirthtuple
    

The reason your original code returns no answer is because the line:

    
    
    for i in filename:
    

filename is an empty string, there is nothing to iterate over, so there are
never any values assigned to i. As such your loop is skipped entirely so
datelist never gets assigned

