python print只能显示首尾30个数据,其他是省略号,请问如何解决

如题所述

第1个回答  2020-08-30
print是将之后的内容输出到终端显示;
print
>>是将内容输出定向到某文件;
例如:
fpa=open("test.txt","w")teststr="hello
world!"print
>>
fpa,
teststrfpa.close()就是将teststr字符串写到text.txt文件中。
相似回答