def spam():
    for i in range(100000):
        open('spam.txt')

def eggs():
    for i in range(100000):
        f = open('eggs.txt')

def beans():

    def toast():
        f = open('toast.txt')
about close a file in Python