# 设置与下一段间隔 Pt(0) # paragraph_format.space_before = Pt(0) # paragraph_format.right_indent = Pt(0) rn = p_new.add_run(r_text,r.style) self.copyFont(r, rn) rn.font.name = 'Arial' rn.font.size = Pt(10)
# # 设置与上一段间隔 Pt(0) paragraph_format = p_new.paragraph_format # paragraph_format.alignment = WD_PARAGRAPH_ALIGNMENT.JUSTIFY # paragraph_format.space_after = Pt(0) # paragraph_format.left_indent = Pt(0) # paragraph_format.space_before = Pt(0) # paragraph_format.right_indent = Pt(0) rn = p_new.add_run(r_text,r.style) self.copyFont(r, rn) rn.font.name = 'Arial' rn.font.size = Pt(10)
都没有作用 原因是提哦换的r_text中手动添加了\n
_5arm_seq_f_all += _5arm_seq_f + '\n' #去掉 _5arm_seq_r_all += _5arm_seq_r + '\n' if re.search(r'@primer_enzyme._5arm.primer_info.primer_seq_f', r.text): r_text = r.text.replace('@primer_enzyme._5arm.primer_info.primer_seq_f', _5arm_seq_f_all)
去掉标记行的\n