I'm trying some things in python, in the hope to learn it. I'm on Ubuntu 20.04. I have the following problem:
When I write a script and I want to try it, making changes and re-running it to see what happens, I use a text editor (Geany).
Now I have written, among other things in my script, a function that populates a very long list (43.5MB). If I want to inspect one element of the list and I write print(mylist[0][0]['key']) for instance, the list gets repopulated when I re-run the script, which takes a long time. But the list is already in memory and it doesn't change in the second run. If I however do change something in the rest of the code, e.g. the list generating part, then I can easily re-run the whole thing and see the effect of the changes.
If I do it in the python console, then I can just print the list changing the indices according to the element I want to inspect, but if I then want to change something in the list generation, that's not that easy.
So I have a dilemma. Is there a way to run the script once and then access the list changing the indices without having to re-run the script, while at the same time keeping the flexibility to also change other parts of the script and run it again?