1

I've been working on some scripts that pull data from the web in JSON format and convert to CSV files. There are roughly 20 scripts and I'm looking for the best way to run them at once. Right now I just type python script1.py into Windows PowerShell and then repeat. Is there an easy way to go about this?

1
  • 1
    You can create a script which runs the scripts :) Commented Nov 17, 2017 at 0:52

2 Answers 2

1

You could use separate processes to run scripts

it could be helpful to read subprocess module

import subprocess
for fileName in files:
    subprocess.Popen(['./{}.py'.format(fileName)])
Sign up to request clarification or add additional context in comments.

Comments

1

A way you could do this is by making another script that runs the different programs.

For example what you would do is:

exec(open("[where ever the file is located]").read())

Then you could have it run a certain amount of times in a for loop and take the file names out of an array!

Files = ['C:\\filename.py', 'C:\\filename2.py']

and so on.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.