【发布时间】:2012-07-30 20:31:41
【问题描述】:
我在阅读特定行时遇到问题。这类似于这里回答的问题: python - Read file from and to specific lines of text 不同的是,我没有固定的结束标记。让我举个例子:
--------------------------------
\n
***** SOMETHING ***** # i use this as my start
\n
--------------------------------
\n
data of interest
data of interest
data of interest
\n
----------------------- #this will either be dashes, or EOF
***** SOMETHING *****
-----------------------
我尝试执行与上述链接类似的操作,但我无法创建 if 语句来中断循环,因为我不知道它是否会是 EOF。
【问题讨论】: