md5hash/md5hash.py
def scan(tree):
    """Scan the directory and send the obtained tuple to calculate.
       :param tree: path to file or directory"""

    tree = os.path.normpath(tree)
    assert os.path.exists(tree), "#Error. The path '{}' is" \
                                 " invalid or doesn't exist.".format(str(tree))

    if os.path.isfile(tree):
        return md5(tree)
    elif os.path.isdir(tree):
        tree = os.walk(tree)
        for directory in tree:
            print('...................')
            print('Current directory:')
            print(directory[0])  # Current directory
            if not directory[2]:  # Empty directory check
                print('An empty directory.')
                continue
            else:
                print('List of the files in the current directory:')
                print(directory[2])  # Files in the current directory
                print()
            calculate(directory)
def scan(tree):
    """Scan the directory and send the obtained tuple to calculate.
       :param tree: path to file or directory"""

    tree = os.path.normpath(tree)
    assert os.path.exists(tree), "#Error. The path '{}' is" \
                                 " invalid or doesn't exist.".format(str(tree))

    if os.path.isfile(tree):
        return md5(tree)
    elif os.path.isdir(tree):
        tree = os.walk(tree)
        for directory in tree:
            print('...................')
            print('Current directory:')
            print(directory[0])  # Current directory
            if not directory[2]:  # Empty directory check
                print('An empty directory.')
                continue
            else:
                print('List of the files in the current directory:')
                print(directory[2])  # Files in the current directory
                print()
            calculate(directory)
Scan the directory and send the obtained tuple to calculate.
       :param tree: path to file or directory