Python分析pdf简历

版权声明:转载请通过公众号《湾区人工智能》联系我授权,谢谢 https://blog.csdn.net/BTUJACK/article/details/88069366
# -*- coding:utf-8 -*-


import pdfplumber #解析pdf文件,尤其带有表格的文件
from openpyxl import Workbook #读写Excel的文件
import xlrd
from xlutils.copy import copy

    

# 解析:按照文字页边距判断级别(标题或内容)
def parse(pdf):
    targets = {} #保存结果,key是简历左侧内容,value是简历右侧内容。
    for page in pdf.pages: 
        words = page.extract_words(x_tolerance=5) #两页,两个列表
        #print(words)
        
        # 合并距离小于dis的单词,主要是把同一行的东西写在一起,比如街道名字和街道号码肯定要写在一起。通过给哈希表里面添加键,值对。已经被使用过的就标记为FALSE,完整的部分标记为真。
        pre_x = words[0]['x1']  #x1是右边距,x0是左边距, hash['x1']= 355.490, 116.304
        pre_top = words[0]['top'] #hash['top'] = 68.012, 58.932,固定值
        #print(pre_top)
        tolerance = 5 #这个数字是超参数,根据经验判断的;
        for index, word in enumerate(words):
            words[index]['valid'] = True #给每一个Word都添加一个键值对;方便以后决定是否继续添加,hash['valid'] = true;添加新的键值对,index = 0-19
            if index == 0:
                continue
            x0, top = word['x0'], word['top'] #68.064 107.912,每个元素的对应值。
            #print('x0, top', x0, top)
            text = word['text'] #获取每个内容
            if abs(top - pre_top) < 1 and abs(x0 - pre_x) < tolerance: #合并同一行内的内容,比如:0176 和81470662(top相同,差<1,并且左右间隔小于5的字符串
                ppre = 0
                while not words[index - 1 - ppre]['valid']: #words[]= false,说明已经被使用过了,就不用继续添加了
                    ppre += 1
                    print(ppre)
                words[index - 1 - ppre]['text'] += text
                print(words[index - 1 - ppre]['text'])
                words[index]['valid'] = False #被使用过的就标记为FALSE
            pre_x = word['x1'] #更新数字
            pre_top = top
            


        #for index, word in enumerate(words):
            #words[index]['valid'] = True #给每一个Word都添加一个键值对;方便以后决定是否继续添加,hash['valid'] = true;添加新的键值对,index = 0-19
        # 拆分重组,只添加标记为true的部分内容
        distance = [int(word['x0']) for word in words] #对所有x0取整数,两个列表
        #print(distance)
        first_dis = min(distance) #min 68
        #print(first_dis)
        cur_top = None #简历左侧top
        cur_text = None #简历左侧text
        pre_top = 0 #简历右侧高度
        x_dis = 5 #简历左右内容距离
        #x_dis = 50
        y_dis = 3 #同一行高度差在3以内
        for word in words:
            #print(word['top'], word['text'])
            #if not word['valid']:  #word['valid'] = false,说明前面已经使用过了,这里就不处理了
                #continue
            x0, top = word['x0'], word['top']
            text = word['text']
            #print('x0-first_dis', x0-first_dis)
            if abs(x0 - first_dis) < x_dis: #合并起来,主要通过距离区分key 和value部分
                targets[text] = '' 
                cur_text = text #简历左侧内容
                cur_top = top #简历左侧top
                pre = top
            elif cur_top is not None and cur_text is not None:
                if abs(cur_top - top) < y_dis: #在同一行内容相加,简历右侧和简历左侧高度比较
                    targets[cur_text] += text
                elif abs(pre_top - top) < y_dis: #简历右侧同一高度添加到一起
                    targets[cur_text] += ' ' + text #保证右侧内容能够放在一行,例如:硕士论文课题: „Tribologische Untersuchung strukturierter
                else:
                    pre_top = top
                    targets[cur_text] += '\n' + text #保证右侧一个内容块的内容要添加,而不是只添加右侧第一行内容
                    #print(targets)
    #print(targets)
    return targets


# 保存
def save(targets, out_path, sheet_name='targets'):
    wb = Workbook()
    ws = wb.active
    ws.title = sheet_name
    #print(list(targets.keys()))
    ws.append(list(targets.keys()))
    ws.append(list(targets.values()))

    wb.save(out_path)


# 主函数入口
print(__doc__)
path = r'/Users/apple/Documents/ST/python/俞伟简历.pdf'
out_path = r'/Users/apple/Documents/ST/python/俞伟简历.xlsx'
pdf = pdfplumber.open(path)
targets = parse(pdf)
save(targets, out_path)

print('运行结束!')










'''
words两列内容,
每页是一列内容;每个列表由无数个字典组成,每个字典由一些key,value对组成;简历里面的每个内容都会有一个字典包括,字典指明了这个内容的前后左右页边距;字典里text对应的value就是pdf内容了,提取出来就行。
x0是text内容左侧距离左边的距离,x1是text内容右侧距离左边的距离;如何保证把左侧放在表头,右侧放在表头下面呢?
[{'x0': Decimal('251.090'), 'x1': Decimal('355.490'), 'top': Decimal('68.012'), 'bottom': Decimal('94.052'), 'text': '个人简历'}, {'x0': Decimal('68.064'), 'x1': Decimal('116.304'), 'top': Decimal('107.912'), 'bottom': Decimal('119.912'), 'text': '基本信息'}, {'x0': Decimal('68.064'), 'x1': Decimal('104.172'), 'top': Decimal('141.152'), 'bottom': Decimal('153.152'), 'text': '姓名:'}, {'x0': Decimal('215.090'), 'x1': Decimal('239.090'), 'top': Decimal('141.152'), 'bottom': Decimal('153.152'), 'text': '俞伟'}, {'x0': Decimal('68.064'), 'x1': Decimal('104.172'), 'top': Decimal('157.472'), 'bottom': Decimal('169.472'), 'text': '地址:'}, {'x0': Decimal('215.090'), 'x1': Decimal('290.426'), 'top': Decimal('154.616'), 'bottom': Decimal('170.372'), 'text': 'Vogelpothsweg'}, {'x0': Decimal('293.330'), 'x1': Decimal('305.330'), 'top': Decimal('154.616'), 'bottom': Decimal('170.372'), 'text': '82'}, {'x0': Decimal('215.090'), 'x1': Decimal('245.090'), 'top': Decimal('170.816'), 'bottom': Decimal('186.572'), 'text': '44227'}, {'x0': Decimal('248.090'), 'x1': Decimal('297.398'), 'top': Decimal('170.816'), 'bottom': Decimal('186.572'), 'text': 'Dortmund'}, {'x0': Decimal('68.064'), 'x1': Decimal('104.172'), 'top': Decimal('189.992'), 'bottom': Decimal('201.992'), 'text': '电话:'}, {'x0': Decimal('215.090'), 'x1': Decimal('239.090'), 'top': Decimal('187.136'), 'bottom': Decimal('202.892'), 'text': '0176'}, {'x0': Decimal('242.090'), 'x1': Decimal('290.090'), 'top': Decimal('187.136'), 'bottom': Decimal('202.892'), 'text': '81470662'}, {'x0': Decimal('68.064'), 'x1': Decimal('128.280'), 'top': Decimal('206.312'), 'bottom': Decimal('218.312'), 'text': '电子邮箱:'}, {'x0': Decimal('215.090'), 'x1': Decimal('333.722'), 'top': Decimal('203.456'), 'bottom': Decimal('219.212'), 'text': '[email protected]'}, {'x0': Decimal('68.064'), 'x1': Decimal('128.292'), 'top': Decimal('222.632'), 'bottom': Decimal('234.632'), 'text': '出生日期:'}, {'x0': Decimal('215.090'), 'x1': Decimal('278.090'), 'top': Decimal('219.776'), 'bottom': Decimal('235.532'), 'text': '1987年8月'}, {'x0': Decimal('68.064'), 'x1': Decimal('116.280'), 'top': Decimal('255.392'), 'bottom': Decimal('267.392'), 'text': '教育背景'}, {'x0': Decimal('68.064'), 'x1': Decimal('107.424'), 'top': Decimal('282.506'), 'bottom': Decimal('302.930'), 'text': '04/2011'}, {'x0': Decimal('110.420'), 'x1': Decimal('114.416'), 'top': Decimal('282.506'), 'bottom': Decimal('302.930'), 'text': '-'}, {'x0': Decimal('117.380'), 'x1': Decimal('156.740'), 'top': Decimal('282.506'), 'bottom': Decimal('302.930'), 'text': '08/2016'}, {'x0': Decimal('215.090'), 'x1': Decimal('311.090'), 'top': Decimal('289.622'), 'bottom': Decimal('301.622'), 'text': '多特蒙德工业大学'}, {'x0': Decimal('236.090'), 'x1': Decimal('416.110'), 'top': Decimal('305.942'), 'bottom': Decimal('317.942'), 'text': '机械工程学院,机械工程系,硕士'}, {'x0': Decimal('215.090'), 'x1': Decimal('218.855'), 'top': Decimal('311.719'), 'bottom': Decimal('317.313'), 'text': '(cid:122)'}, {'x0': Decimal('236.090'), 'x1': Decimal('536.140'), 'top': Decimal('322.262'), 'bottom': Decimal('334.262'), 'text': '主修方向:机械加工技术,材料表面处理,机器自动化,'}, {'x0': Decimal('215.090'), 'x1': Decimal('218.855'), 'top': Decimal('328.039'), 'bottom': Decimal('333.633'), 'text': '(cid:122)'}, {'x0': Decimal('296.090'), 'x1': Decimal('368.110'), 'top': Decimal('338.462'), 'bottom': Decimal('350.462'), 'text': '机械质量检测'}, {'x0': Decimal('236.090'), 'x1': Decimal('311.426'), 'top': Decimal('351.926'), 'bottom': Decimal('367.682'), 'text': '硕士论文课题:'}, {'x0': Decimal('314.450'), 'x1': Decimal('386.290'), 'top': Decimal('351.530'), 'bottom': Decimal('367.682'), 'text': '„Tribologische'}, {'x0': Decimal('389.338'), 'x1': Decimal('456.754'), 'top': Decimal('351.926'), 'bottom': Decimal('367.682'), 'text': 'Untersuchung'}, {'x0': Decimal('459.700'), 'x1': Decimal('522.364'), 'top': Decimal('351.926'), 'bottom': Decimal('367.682'), 'text': 'strukturierter'}, {'x0': Decimal('215.090'), 'x1': Decimal('218.855'), 'top': Decimal('360.559'), 'bottom': Decimal('366.153'), 'text': '(cid:122)'}, {'x0': Decimal('236.090'), 'x1': Decimal('268.718'), 'top': Decimal('368.246'), 'bottom': Decimal('384.002'), 'text': 'CrAlN'}, {'x0': Decimal('271.718'), 'x1': Decimal('289.718'), 'top': Decimal('368.246'), 'bottom': Decimal('384.002'), 'text': 'und'}, {'x0': Decimal('292.718'), 'x1': Decimal('333.398'), 'top': Decimal('368.246'), 'bottom': Decimal('384.002'), 'text': 'CrAlCN'}, {'x0': Decimal('336.398'), 'x1': Decimal('399.662'), 'top': Decimal('368.246'), 'bottom': Decimal('384.002'), 'text': 'beschichteter'}, {'x0': Decimal('402.602'), 'x1': Decimal('491.428'), 'top': Decimal('367.850'), 'bottom': Decimal('384.002'), 'text': 'Funktionsflächen“'}, {'x0': Decimal('494.380'), 'x1': Decimal('537.376'), 'top': Decimal('367.850'), 'bottom': Decimal('384.002'), 'text': '(基于Cr'}, {'x0': Decimal('236.090'), 'x1': Decimal('432.106'), 'top': Decimal('384.566'), 'bottom': Decimal('400.322'), 'text': '合金图层以及表面结构对摩擦的影响)'}, {'x0': Decimal('68.064'), 'x1': Decimal('107.420'), 'top': Decimal('412.946'), 'bottom': Decimal('433.370'), 'text': '09/2009'}, {'x0': Decimal('110.420'), 'x1': Decimal('114.416'), 'top': Decimal('412.946'), 'bottom': Decimal('433.370'), 'text': '-'}, {'x0': Decimal('117.380'), 'x1': Decimal('156.740'), 'top': Decimal('412.946'), 'bottom': Decimal('433.370'), 'text': '12/2010'}, {'x0': Decimal('215.090'), 'x1': Decimal('359.110'), 'top': Decimal('420.062'), 'bottom': Decimal('432.062'), 'text': '多特蒙德工业大学语言中心'}, {'x0': Decimal('68.064'), 'x1': Decimal('107.424'), 'top': Decimal('445.486'), 'bottom': Decimal('465.910'), 'text': '09/2005'}, {'x0': Decimal('110.420'), 'x1': Decimal('114.416'), 'top': Decimal('445.486'), 'bottom': Decimal('465.910'), 'text': '-'}, {'x0': Decimal('117.380'), 'x1': Decimal('156.740'), 'top': Decimal('445.486'), 'bottom': Decimal('465.910'), 'text': '07/2009'}, {'x0': Decimal('215.090'), 'x1': Decimal('287.090'), 'top': Decimal('452.602'), 'bottom': Decimal('464.602'), 'text': '安徽工业大学'}, {'x0': Decimal('236.090'), 'x1': Decimal('488.140'), 'top': Decimal('468.922'), 'bottom': Decimal('480.922'), 'text': '机械工程学院,机械设计制造及其自动化,本科'}, {'x0': Decimal('215.090'), 'x1': Decimal('218.855'), 'top': Decimal('474.699'), 'bottom': Decimal('480.293'), 'text': '(cid:122)'}, {'x0': Decimal('236.090'), 'x1': Decimal('512.140'), 'top': Decimal('485.242'), 'bottom': Decimal('497.242'), 'text': '本科论文课题:基于时域分析的齿轮箱故障诊断方法'}, {'x0': Decimal('215.090'), 'x1': Decimal('218.855'), 'top': Decimal('491.019'), 'bottom': Decimal('496.613'), 'text': '(cid:122)'}, {'x0': Decimal('68.064'), 'x1': Decimal('107.400'), 'top': Decimal('510.766'), 'bottom': Decimal('531.190'), 'text': '09/1993'}, {'x0': Decimal('110.420'), 'x1': Decimal('114.416'), 'top': Decimal('510.766'), 'bottom': Decimal('531.190'), 'text': '-'}, {'x0': Decimal('117.380'), 'x1': Decimal('156.716'), 'top': Decimal('510.766'), 'bottom': Decimal('531.190'), 'text': '07/2005'}, {'x0': Decimal('215.090'), 'x1': Decimal('359.110'), 'top': Decimal('517.882'), 'bottom': Decimal('529.882'), 'text': '安徽省巢湖市皖维子弟学校'}, {'x0': Decimal('68.064'), 'x1': Decimal('152.420'), 'top': Decimal('566.842'), 'bottom': Decimal('578.842'), 'text': '实习和项目经历'}, {'x0': Decimal('68.064'), 'x1': Decimal('107.400'), 'top': Decimal('593.926'), 'bottom': Decimal('614.350'), 'text': '04/2013'}, {'x0': Decimal('110.420'), 'x1': Decimal('114.416'), 'top': Decimal('593.926'), 'bottom': Decimal('614.350'), 'text': '-'}, {'x0': Decimal('117.380'), 'x1': Decimal('156.716'), 'top': Decimal('593.926'), 'bottom': Decimal('614.350'), 'text': '04/2014'}, {'x0': Decimal('215.090'), 'x1': Decimal('443.110'), 'top': Decimal('601.042'), 'bottom': Decimal('613.042'), 'text': '多特蒙德工业大学成型及轻量化设计研究所'}, {'x0': Decimal('236.090'), 'x1': Decimal('296.090'), 'top': Decimal('617.392'), 'bottom': Decimal('629.392'), 'text': '项目名称:'}, {'x0': Decimal('298.610'), 'x1': Decimal('538.660'), 'top': Decimal('617.392'), 'bottom': Decimal('629.392'), 'text': '基于铝箔瞬时蒸发的成型过程以及有限元分析'}, {'x0': Decimal('215.090'), 'x1': Decimal('218.855'), 'top': Decimal('623.169'), 'bottom': Decimal('628.763'), 'text': '(cid:122)'}, {'x0': Decimal('236.090'), 'x1': Decimal('299.690'), 'top': Decimal('630.856'), 'bottom': Decimal('646.612'), 'text': '通过CATIA'}, {'x0': Decimal('302.690'), 'x1': Decimal('317.354'), 'top': Decimal('630.856'), 'bottom': Decimal('646.612'), 'text': 'V5'}, {'x0': Decimal('320.350'), 'x1': Decimal('338.350'), 'top': Decimal('630.856'), 'bottom': Decimal('646.612'), 'text': 'und'}, {'x0': Decimal('341.458'), 'x1': Decimal('355.330'), 'top': Decimal('630.856'), 'bottom': Decimal('646.612'), 'text': 'LS'}, {'x0': Decimal('358.510'), 'x1': Decimal('492.220'), 'top': Decimal('630.856'), 'bottom': Decimal('646.612'), 'text': 'DYNA软件进行模拟建模'}, {'x0': Decimal('215.090'), 'x1': Decimal('218.855'), 'top': Decimal('639.489'), 'bottom': Decimal('645.083'), 'text': '(cid:122)'}, {'x0': Decimal('236.090'), 'x1': Decimal('524.140'), 'top': Decimal('650.032'), 'bottom': Decimal('662.032'), 'text': '设计实验所需要的构架和制作,通过实验获得数据结果'}, {'x0': Decimal('215.090'), 'x1': Decimal('218.855'), 'top': Decimal('655.809'), 'bottom': Decimal('661.403'), 'text': '(cid:122)'}, {'x0': Decimal('236.090'), 'x1': Decimal('500.140'), 'top': Decimal('666.352'), 'bottom': Decimal('678.352'), 'text': '通过比较模拟和实验结果验证有限元模拟的准确性'}, {'x0': Decimal('215.090'), 'x1': Decimal('218.855'), 'top': Decimal('672.129'), 'bottom': Decimal('677.723'), 'text': '(cid:122)'}, {'x0': Decimal('68.064'), 'x1': Decimal('107.420'), 'top': Decimal('691.756'), 'bottom': Decimal('712.180'), 'text': '04/2013'}, {'x0': Decimal('110.420'), 'x1': Decimal('114.416'), 'top': Decimal('691.756'), 'bottom': Decimal('712.180'), 'text': '-'}, {'x0': Decimal('117.380'), 'x1': Decimal('156.740'), 'top': Decimal('691.756'), 'bottom': Decimal('712.180'), 'text': '07/2013'}, {'x0': Decimal('215.090'), 'x1': Decimal('395.110'), 'top': Decimal('698.872'), 'bottom': Decimal('710.872'), 'text': '多特蒙德工业大学切削成型研究所'}, {'x0': Decimal('236.090'), 'x1': Decimal('287.426'), 'top': Decimal('712.336'), 'bottom': Decimal('728.092'), 'text': '项目名称:'}, {'x0': Decimal('293.450'), 'x1': Decimal('497.500'), 'top': Decimal('715.192'), 'bottom': Decimal('727.192'), 'text': '基于力测量下切削刀头转动过程的优化'}, {'x0': Decimal('215.090'), 'x1': Decimal('218.855'), 'top': Decimal('720.969'), 'bottom': Decimal('726.563'), 'text': '(cid:122)'}, {'x0': Decimal('236.090'), 'x1': Decimal('380.110'), 'top': Decimal('731.512'), 'bottom': Decimal('743.512'), 'text': '制定实验计划以及实验操作'}, {'x0': Decimal('215.090'), 'x1': Decimal('218.855'), 'top': Decimal('737.289'), 'bottom': Decimal('742.883'), 'text': '(cid:122)'}, {'x0': Decimal('236.090'), 'x1': Decimal('392.110'), 'top': Decimal('747.828'), 'bottom': Decimal('759.828'), 'text': '通过电子显微镜分析实验结果'}, {'x0': Decimal('215.090'), 'x1': Decimal('218.855'), 'top': Decimal('753.605'), 'bottom': Decimal('759.199'), 'text': '(cid:122)'}]
[{'x0': Decimal('68.064'), 'x1': Decimal('116.304'), 'top': Decimal('58.932'), 'bottom': Decimal('70.932'), 'text': '其他技能'}, {'x0': Decimal('89.064'), 'x1': Decimal('170.420'), 'top': Decimal('90.416'), 'bottom': Decimal('106.172'), 'text': '熟练运用Word,'}, {'x0': Decimal('173.420'), 'x1': Decimal('203.744'), 'top': Decimal('90.416'), 'bottom': Decimal('106.172'), 'text': 'Excel,'}, {'x0': Decimal('206.648'), 'x1': Decimal('290.450'), 'top': Decimal('90.416'), 'bottom': Decimal('106.172'), 'text': 'PPT等办公软件'}, {'x0': Decimal('68.064'), 'x1': Decimal('71.829'), 'top': Decimal('99.049'), 'bottom': Decimal('104.643'), 'text': '(cid:122)'}, {'x0': Decimal('89.064'), 'x1': Decimal('165.416'), 'top': Decimal('106.736'), 'bottom': Decimal('122.492'), 'text': '熟练运动Catia'}, {'x0': Decimal('168.380'), 'x1': Decimal('186.044'), 'top': Decimal('106.736'), 'bottom': Decimal('122.492'), 'text': 'V5,'}, {'x0': Decimal('189.044'), 'x1': Decimal('241.328'), 'top': Decimal('106.736'), 'bottom': Decimal('122.492'), 'text': 'AutoCAD,'}, {'x0': Decimal('244.436'), 'x1': Decimal('258.188'), 'top': Decimal('106.736'), 'bottom': Decimal('122.492'), 'text': 'LS'}, {'x0': Decimal('261.224'), 'x1': Decimal('455.110'), 'top': Decimal('106.736'), 'bottom': Decimal('122.492'), 'text': 'DYNA等机械设计和有限元模拟软件'}, {'x0': Decimal('68.064'), 'x1': Decimal('71.829'), 'top': Decimal('115.369'), 'bottom': Decimal('120.963'), 'text': '(cid:122)'}, {'x0': Decimal('89.064'), 'x1': Decimal('141.980'), 'top': Decimal('122.936'), 'bottom': Decimal('138.692'), 'text': '德语B2,'}, {'x0': Decimal('147.980'), 'x1': Decimal('220.130'), 'top': Decimal('122.936'), 'bottom': Decimal('138.692'), 'text': '大学英语4级'}, {'x0': Decimal('68.064'), 'x1': Decimal('71.829'), 'top': Decimal('131.569'), 'bottom': Decimal('137.163'), 'text': '(cid:122)'}, {'x0': Decimal('68.064'), 'x1': Decimal('116.304'), 'top': Decimal('158.552'), 'bottom': Decimal('170.552'), 'text': '兴趣爱好'}, {'x0': Decimal('68.064'), 'x1': Decimal('224.090'), 'top': Decimal('192.752'), 'bottom': Decimal('204.752'), 'text': '电脑技术,足球,篮球,游泳'}, {'x0': Decimal('98.064'), 'x1': Decimal('122.060'), 'top': Decimal('311.702'), 'bottom': Decimal('323.702'), 'text': '俞伟'}, {'x0': Decimal('386.110'), 'x1': Decimal('435.418'), 'top': Decimal('308.846'), 'bottom': Decimal('324.602'), 'text': 'Dortmund'}, {'x0': Decimal('68.064'), 'x1': Decimal('207.780'), 'top': Decimal('320.846'), 'bottom': Decimal('336.602'), 'text': '-----------------------------------'}, {'x0': Decimal('358.030'), 'x1': Decimal('513.586'), 'top': Decimal('320.846'), 'bottom': Decimal('336.602'), 'text': '---------------------------------------'}]
运行结束!
[Finished in 1.0s]

words[0]
解析PDF文件,根据文字页边距判断等级关系,最终内容保存到Excel....
{'x0': Decimal('251.090'), 'x1': Decimal('355.490'), 'top': Decimal('68.012'), 'bottom': Decimal('94.052'), 'text': '个人简历'}
{'x0': Decimal('68.064'), 'x1': Decimal('116.304'), 'top': Decimal('58.932'), 'bottom': Decimal('70.932'), 'text': '其他技能'}
运行结束!
[Finished in 0.9s]

print(words[index])内容,只不过添加了一个标记,valid,true

{'x0': Decimal('251.090'), 'x1': Decimal('355.490'), 'top': Decimal('68.012'), 'bottom': Decimal('94.052'), 'text': '个人简历', 'valid': True}

distance:
[251, 68, 68, 215, 68, 215, 293, 215, 248, 68, 215, 242, 68, 215, 68, 215, 68, 68, 110, 117, 215, 236, 215, 236, 215, 296, 236, 314, 389, 459, 215, 236, 271, 292, 336, 402, 494, 236, 68, 110, 117, 215, 68, 110, 117, 215, 236, 215, 236, 215, 68, 110, 117, 215, 68, 68, 110, 117, 215, 236, 298, 215, 236, 302, 320, 341, 358, 215, 236, 215, 236, 215, 68, 110, 117, 215, 236, 293, 215, 236, 215, 236, 215]
[68, 89, 173, 206, 68, 89, 168, 189, 244, 261, 68, 89, 147, 68, 68, 68, 98, 386, 68, 358]
运行结束!
[Finished in 1.0s]

#print(cur_text)
None


[Finished in 1.0s]

targets[cur_text] += text
targets[cur_text] += '\n' + text
None

猜你喜欢

转载自blog.csdn.net/BTUJACK/article/details/88069366