I have an analyze.py file that performs three steps:
- it imports a .csv file as a numpy array;
- it asks for user input
(e.g.
x=input ('Enter a number by which you want to multiply your array?')
- uses that input to perform some array operations
(e.g.
output_array=csv_array*x
).
After step 3, I would like to close the existing window and automatically run a second .py file which imports the new array (output_array).
In other words, I would like to pass a user-input variable from one py file to another. How can I do it?
Please note that I am aware of similar questions (e.g. How can I make one python file run another?), but I cannot guess how to deal with user input.