<jupyter_start><jupyter_text>Markdown<jupyter_code>class Kaifang(object):
    """docstring for Kaifang"""

    def __init__(self):
        self.file_path ='C:\\Users\\Administrator.SD-201608211550\\Desktop.kaifangX.txt' 
        self.man = 0
        self.woman = 0
        self.lines_total = 0
        self.lines = None

    def total_line(self):
        with open(self.file_path, 'r', encoding='gbk', errors='ignore') as f:
            self.lines = f.readlines() # 返回的是一个列表
            self.lines_total = len(self.lines) # 获得所有行数
            print(self.lines_total)

    def get_man_woman(self):
        self.total_line()
        for line in self.lines:
            try:
                gender = line.split(',')[2]
                if gender == 'F':
                    self.woman += 1
                if gender == 'M':
                    self.man += 1
            except Exception as e:
                print(e)
                print('未获取到性别')
                continue
        print('woman:%d' % self.woman)
        print('man:%d' % self.man)

    def percent(self):
        self.get_man_woman()
        print('woman percent is:', (self.woman / self.lines_total) * 100, '%')
        print('man percent is:', (self.man / self.lines_total) * 100, '%')

import itertools

nana=(x for x in itertools.product('1234560',repeat=2))
for i in nana:
    print(i)<jupyter_output>('1', '1')
('1', '2')
('1', '3')
('1', '4')
('1', '5')
('1', '6')
('1', '0')
('2', '1')
('2', '2')
('2', '3')
('2', '4')
('2', '5')
('2', '6')
('2', '0')
('3', '1')
('3', '2')
('3', '3')
('3', '4')
('3', '5')
('3', '6')
('3', '0')
('4', '1')
('4', '2')
('4', '3')
('4', '4')
('4', '5')
('4', '6')
('4', '0')
('5', '1')
('5', '2')
('5', '3')
('5', '4')
('5', '5')
('5', '6')
('5', '0')
('6', '1')
('6', '2')
('6', '3')
('6', '4')
('6', '5')
('6', '6')
('6', '0')
('0', '1')
('0', '2')
('0', '3')
('0', '4')
('0', '5')
('0', '6')
('0', '0')
{'fraction_non_alphanumeric': 0.27620545073375263, 'fraction_numerical': 0.06813417190775681, 'mean_word_length': 2.314236111111111, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '631521', 'license': 'Apache-2.0', 'n_tokens_mistral': 823, 'n_tokens_neox': 790, 'n_words': 188, 'path': 'DAY8.ipynb', 'repo_name': 'leibaoawa/tongjierban', 'size': '1908'}