VSC Python 编译器不打印整个列表 [英] VSC Python complier not printing the whole list
问题描述
我使用 Visual Studio Code 进行任何编码,最近我注意到一件奇怪的事情.每当我尝试打印一个很长的列表时,列表没有完全打印出来,而是被截断了.
I use Visual Studio Code for any coding and recently I noticed a strange thing. Whenever I try to print a really long list, the list is not printed completely, it is cut off.
primes=[]
for i in range(1000000):
primes.append(str(i))
print(primes)
print(len(primes))
print(primes[-1])
列表长度为 1 000 000 个单位,列表中的最后一个数字如预期的那样为 999 999,但列表未完全打印.
输出为:
The list is 1 000 000 units long and last number in the list is 999 999 as expected but the list is not printed completely.
Output is:
["0", "1", ..., "1345"
1000000
999999
这可能是编译器错误吗?
谢谢你的每一个建议.
May this be a compiler error?
Thanks for every suggestion.
推荐答案
我在vscode中试过你的代码,需要增加terminal
的Integrated:Scrollback
设置在您的 vscode 设置中:
I have tried your code in vscode, you need to increase the Integrated:Scrollback
setting for terminal
in your vscode settings:
- 转到文件 -> 首选项 -> 设置或按 Ctrl+Shift+p
- 搜索终端回滚"
- 将值更改为
100000
- 重新加载 vscode 窗口
这篇关于VSC Python 编译器不打印整个列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!