I have a central python script that calls various other python scripts and looks like this:

```
os.system("python " + script1 + args1)
os.system("python " + script2 + args2)
os.system("python " + script3 + args3)

```

Now, I want to exit from my central script if any of the sub-scripts encounter an error.

What is happening with current code is that let's say script1 encounters an error. The console will display that error and then central script will move onto calling script2 and so on.

I want to display the encountered error and immediately exit my central code.

What is the best way to do this?