<分区> 分区>
Possible Duplicate:
get nth line of string in python
有没有办法从 Python 中的多行字符串中获取指定行?例如:
>>> someString = 'Hello\nthere\npeople\nof\nEarth'
>>> aNewString = someString.line(1)
>>> print aNewString
there
我想制作一个简单的“解释器”风格的脚本,循环遍历它所提供的文件的每一行。
