Mar-21-2018, 10:21 PM
Hi all,
I have two scripts, say script1.py and script2.py. In script1 I calculate a lot of parameters and matrices, and it takes time, say 30 mins to run script1. Then I want to use these calculated parameters to do graphs or other small calculations. So I try to import script1 into script2 and do the plots. However, whenever I import another script, it runs the entire script1, and it takes again 30 minutes. So basically even if I have to make a small change in a graph, I need to re-run the code for half hour. How to do this efficiently? Basically I want to know, once I run my script, is there a way to save all the calculated variables somehow so that I can import them multiple times later, instead of running the entire code again.
I have two scripts, say script1.py and script2.py. In script1 I calculate a lot of parameters and matrices, and it takes time, say 30 mins to run script1. Then I want to use these calculated parameters to do graphs or other small calculations. So I try to import script1 into script2 and do the plots. However, whenever I import another script, it runs the entire script1, and it takes again 30 minutes. So basically even if I have to make a small change in a graph, I need to re-run the code for half hour. How to do this efficiently? Basically I want to know, once I run my script, is there a way to save all the calculated variables somehow so that I can import them multiple times later, instead of running the entire code again.