python逐行输出文件内容、但每行以prefix开头_使用Python删除文本文件中以特定字符开头的行...

我有这样一个讨厌的输出文件:*** Warning: OpenMpAssembler::assemble_interior_facets is untested.

*** Warning: Form::coloring does not properly consider form type.

Coloring mesh.

*** Warning: Form::coloring does not properly consider form type.

Coloring mesh.

*** Warning: Form::coloring does not properly consider form type.

Solving linear system of size 108360 x 108360 (PETSc Krylov solver).

Solving linear system of size 36120 x 36120 (PETSc Krylov solver).

*** Warning: Form::coloring does not properly consider form type.

*** Warning: Form::coloring does not properly consider form type.

*** Warning: Form::coloring does not properly consider form type.

*** Warning: Form::coloring does not properly consider form type.

0/240 +0.000000e+00 -1.146247e-08 +0.000000e+00 +1.913417e-03 +0.000000e+00 +0.000000e+00

*** Warning: OpenMpAssembler::assemble_interior_facets is untested.

*** Warning: Form::coloring does not properly consider form type.

*** Warning: Form::coloring does not properly consider form type.

Solving linear system of size 108360 x 108360 (PETSc Krylov solver).

Solving linear system of size 36120 x 36120 (PETSc Krylov solver).

*** Warning: Form::coloring does not properly consider form type.

*** Warning: Form::coloring does not properly consider form type.

*** Warning: Form::coloring does not properly consider form type.

*** Warning: Form::coloring does not properly consider form type.

1/240 +5.000000e-05 -2.024630e-08 -3.666293e-08 +1.913417e-03 +1.073840e-10 +3.479053e-21

*** Warning: OpenMpAssembler::assemble_interior_facets is untested.

*** Warning: Form::coloring does not properly consider form type.

*** Warning: Form::coloring does not properly consider form type.

Solving linear system of size 108360 x 108360 (PETSc Krylov solver).

Solving linear system of size 36120 x 36120 (PETSc Krylov solver).

*** Warning: Form::coloring does not properly consider form type.

*** Warning: Form::coloring does not properly consider form type.

*** Warning: Form::coloring does not properly consider form type.

*** Warning: Form::coloring does not properly consider form type.

2/240 +1.000000e-04 -3.529024e-08 -3.825476e-08 +1.913417e-03 +1.077877e-10 +2.308941e-20

名单还在继续,我只是想摘录

^{pr2}$

如何在Python中实现它?基本上我想忽略以*开头的行,着色和求解

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
©️2020 CSDN 皮肤主题: 深蓝海洋 设计师:CSDN官方博客 返回首页