擅长:python、mysql、java
<p>您需要将编码为多行的单行连接起来,但它们都以<code>','</code>结尾(如果您下面的pep8是代码)
例如:</p>
<pre><code>CP.TEST.AppendList(Name='CANHOLE', Values=[ 3, 4, ],
var='LV')
</code></pre>
<p>将其临时转换为:</p>
<pre><code>CP.TEST.AppendList(Name='CANHOLE', Values=[ 3, 4, ],var='LV')
</code></pre>
<p>现在开始搜索</p>
<pre><code>with open('colorlabel.py','r') as file:
temp=''
for i in file:
if i.strip().endswith(','):
temp+=i
else:
temp+=i
if 'lv' in temp:
print ' >>',temp
temp=""
</code></pre>