#!/Usr/bin/python3.8

# ļ
testFile= open("d:/test.txt", "r")
print ("ļΪ", testFile.name)

for index in range(4):
    line = next(testFile)
    print (" %d  - %s" % (index, line))

# رļ
testFile.close()
ϳнΪ
ļΪd:/testFile.txt
 0  - 2:www.nfu.edu.cn 2: www.nfu.edu.cn
 1  - Python is very good
Traceback (most recent call last):
  File "C:/Users/57877/AppData/Local/Programs/Python/Python3.8/1..py", line 10, in <module>
    line = next(fo)
StopIteration