import logginglogging.basicConfig(level=logging.INFO) ‘‘‘def check_number_exist(password_str): has_number = False for c in password_str: if c.isnumber(): has_number = True break return has_number def check_letter_exist(password_str): has_letter = False for c in password_str: if c.isalpha(): has_letter = True break return has_letter‘‘‘ def main(): f = open(‘password.txt‘,‘r‘) for line in f: logging.info(‘read:{}‘.format(line)) f.close() if __name__ == ‘__main__‘: main()
原文地址:https://www.cnblogs.com/Jessie-02/p/12625853.html
时间: 2024-11-02 14:07:26