我对 Python 很陌生,通常习惯于 Java。我目前正在尝试解析由 Praat 输出的文本文件,该文件始终采用相同的格式,通常看起来像这样,还有更多功能:
-- Voice report for 53. Sound T1_1001501_vowels --
Date: Tue Aug 7 12:15:41 2018
Time range of SELECTION
From 0 to 0.696562 seconds (duration: 0.696562 seconds)
Pitch:
Median pitch: 212.598 Hz
Mean pitch: 211.571 Hz
Standard deviation: 23.891 Hz
Minimum pitch: 171.685 Hz
Maximum pitch: 265.678 Hz
Pulses:
Number of pulses: 126
Number of periods: 113
Mean period: 4.751119E-3 seconds
Standard deviation of period: 0.539182E-3 seconds
Voicing:
Fraction of locally unvoiced frames: 5.970% (12 / 201)
Number of voice breaks: 1
Degree of voice breaks: 2.692% (0.018751 seconds / 0.696562 seconds)
我想输出如下所示的内容:
0.696562,212.598,211.571,23.891,171.685,265.678,126,113,4.751119E-3,0.539182E-3,5.970,1,2.692
所以基本上我想从每行打印出冒号和后面的空格之间的数字字符串,用逗号分隔。我知道这可能是一个愚蠢的问题,但我无法用 Python 解决它;任何帮助将非常感激!