was told to use pass but the program just ends how do I keep it going?

Code:
import os
import hashlib
import sys

start_path = '/home/lance' # current user home directory
files_dir = []
for path,dirs,files in os.walk(start_path):
    for filename in files:
        files_dir.append(os.path.join(path,filename))
                
def pwalk():
    try:
        for x in files_dir:
            hasher = hashlib.sha256()
            with open(x, 'rb') as openfile:
                content = openfile.read()
                hasher.update(content)
                with open('data.txt', 'a') as f:
                    print(hasher.hexdigest(), x, sep=",", file=f)
    except PermissionError as permission_error:
        print(permission_error)
        pass
    except FileNotFoundError as filenotfounderror:
        pass
        print(filenotfounderror)
    input('Enter to close...')

pwalk()