我有以下代码来读取文本文件。
curl -X GET 'http://localhost:9200/app/product/_search?q=*iphone*&size=500'
它产生以下输出:-
fin= open('C:\\words.txt')
line=fin.readlines()
print(line)
但是,当我省略['aa\n', 'aah\n', 'aahed\n', 'aahing\n', 'aahs\n', 'aal\n', 'aalii\n', 'aaliis\n', 'aals\n', 'aardvark\n', 'aardvarks\n', 'aardwolf\n', 'aardwolves\n', 'aas\n', 'aasvogel\n', 'aasvogels\n', 'aba\n', 'abaca\n', 'abacas\n', 'abaci\n', 'aback\n', 'abacus\n', 'abacuses\n', 'abaft\n', 'abaka\n', 'abakas\n', 'abalone\n', 'abalones\n']
时,
print(line)
然后输出变为:-
fin= open('C:\\words.txt')
fin.readlines()
引入['aa\n',
'aah\n',
'aahed\n',
'aahing\n',
'aahs\n',
'aal\n',
'aalii\n',
'aaliis\n',
'aals\n',
'aardvark\n',
'aardvarks\n',
'aardwolf\n',
'aardwolves\n',
'aas\n',
'aasvogel\n',
'aasvogels\n',
'aba\n',
'abaca\n',
'abacas\n',
'abaci\n',
'aback\n',
'abacus\n',
'abacuses\n',
'abaft\n',
'abaka\n',
'abakas\n',
'abalone\n',
'abalones\n']
函数时为什么会出现这种情况?