Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSC Python complier not printing the whole list

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])

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.

like image 547
GBoGH Avatar asked Feb 20 '26 20:02

GBoGH


1 Answers

I have tried your code in vscode, you need to increase the Integrated:Scrollback setting for terminal in your vscode settings:

  1. Go to File -> Preferences -> Settings or press Ctrl+Shift+p
  2. Search for 'terminal scrollback'

enter image description here

  1. Change the value to 100000
  2. Reload the vscode window
like image 171
isAif Avatar answered Feb 22 '26 09:02

isAif