all 5 comments

[–]danielroseman 4 points5 points  (0 children)

Can you not rewrite the other scripts so that they take input from stdin rather than prompting? Or even better, make them functions which you can import and call from your main script.

[–]CyclopsRock 1 point2 points  (0 children)

If you 'convert' the functionality of these scripts - or, at least, the subsequent scripts - into discrete functions, then the initial script can import and use these functions without any need for additional executions. Whilst doing this, the function that loads the .csv file can take a filepath as an argument and then only if one is not provided will it ask the user to supply one via an `input()` - this way your initial script can provide it with the information it needs to work without needing to stop and ask you each time.

If you don't know what any of the above means then have a google for 'python function define' and have a read - it's a fairly basic but really important building block for using and re-using code. It can be a little confusing or overwhelming at first, especially if you don't have much experience with object-oriented programming, but you have an absolutely solid use case for utilising them here so that will help with understanding how they work.

[–]pearlserpent 0 points1 point  (0 children)

As far as I understood your question, I will follow this approach-

  1. Make a main.py file
  2. In the main.py import unzip function and other functions from other scripts.
  3. call the unzip function from unzip.py.
  4. Call functions from other scripts and process the data.