Here is my code to help you out. Its not perfect for unexpected input and its not super optimized.
you can pipe the file in using stdin:
Quote:ban_checker.py < ban.txt
assuming text file containing plain text organized in username:password like this:
Quote:bob:7423
john:password1
greg:password$$$$
it would then separate each line into either a good.txt or a banned.txt file.
and quick note as stated above, dont store usernames and passwords into plain text files.
PHP Code
<?php
import sys
import os
def main():
username_to_compare = 'john'
good_file = open('good.txt', 'w')
ban_file = open('banned.txt', 'w')
for line in sys.stdin:
stripped_line = line.rstrip()
split_line = stripped_line.split(':')
if username_to_compare in split_line:
ban_file.write(stripped_line + '\n')
else:
good_file.write(stripped_line + '\n')
good_file.close()
ban_file.close()
if __name__ == "__main__":
main()