0

I have a problem with my IDE in python... I want to make a list of numbers i.e (40,000,000) but when i place this command list(range(1000000)) it counted up to that no problem but i tried scrolling down to the start of the code and i noticed that it started from 999000 instead of 1 so i tried this instead list(range(1, 1000000))but it still didn't work out as it should. So what the IDE is actually doing is that if it gets to the maximum capacity, it dumps previous information for new ones. Are there any recommendations as to how to expand the IDE capacity like how it would be in a notepad?

1 Answers1

0

Some IDEs let you increase the number of "last lines" it can show, but soon or later you'll hit the wall again. Instead to output to a terminal emulator, try output to a file.


with open("output.txt", "w") as o:
    for i in range(len(my_list)):
        o.write("%d" % my_list[i])

Just open output.txt on Notepad.

  • Something like this with the code below right? List(range(100)) – Dave Kent Nov 17 '20 at 20:43
  • And i'm thinking if we could put something like "When the process is done; Print "Finished" or "Done" – Dave Kent Nov 17 '20 at 20:50
  • @DaveKent 1 - Yes, you can change for your needs. 2 - You can save (selectively) to a file, like `if my_list[i] % 2 == 0: o.write("%d" % my_list[i])`, and can also print a message to the terminal like `print('Done')`. The point is, you should choose the most appropriate resource to use. – Jorge Guimaraes Nov 18 '20 at 02:15
  • Feedback: I actually made some adjustments by adding a line; 'My_list = list(range(100)) before applying your code so it actually worked. But it combines the answers without commas, for example 10 does this '0123456789' instead of '0,1,2,3,4,5,.....8,9'. any suggestions? – Dave Kent Nov 18 '20 at 17:12
  • It may get out of scope of main question. I suggest you create a new question with your code and what it's supposed to do. But first, check if a similar question was answered before. – Jorge Guimaraes Nov 18 '20 at 19:23
  • Here's the new question [Link](https://stackoverflow.com/questions/64936016/how-can-i-distribute-the-output-of-a-list-i-made-in-python-in-my-notepad/64936064#64936064) – Dave Kent Nov 21 '20 at 03:19