def potter(potfile, outfile):
    """
    Extract cracked passwords from potfile to generate wordlist

    Arguments
    ---------
    potfile: string
        location of potfile
    outfile: string
        location of wordlist file

    Returns
    -------
    ret: boolean
        True if successfully updated

    """
    logger.debug('Updating pot wordlist')
    try:
        with open(potfile, 'r') as fh_pot:
            with open(outfile, 'w+') as fh_out:
                for cracked in fh_pot:
                    if ':' in cracked:
                        split_list = cracked.split(':')
                        if len(split_list[0]) > 1:
                            passwd = split_list[-1]
                        else:
                            passwd = cracked
                    else:
                        passwd = cracked
                    fh_out.write(passwd)
    except (IOError, FileNotFoundError) as err:
        logger.debug('Pot wordlist files not found: {}'.format(err))
        return False
    except Exception as err:
        logger.debug('Pot wordlist update error: {}'.format(err))
        return False
    return True

    Extract cracked passwords from potfile to generate wordlist

    Arguments
    ---------
    potfile: string
        location of potfile
    outfile: string
        location of wordlist file

    Returns
    -------
    ret: boolean
        True if successfully updated

    
crackq/run_hashcat.py