使用正则表达式:
if re.match(r'^s*$', line): # line is empty (has only the following: tnr and whitespace)
使用正则表达式+
filter():
filtered = filter(lambda x: not re.match(r'^s*$', x), original)
如在键盘上所见。

使用正则表达式:
if re.match(r'^s*$', line): # line is empty (has only the following: tnr and whitespace)
使用正则表达式+
filter():
filtered = filter(lambda x: not re.match(r'^s*$', x), original)
如在键盘上所见。