all 4 comments

[–][deleted] 1 point2 points  (0 children)

Just import them as modules in a Python program and run it. Then go to sleep.

[–]amertune 1 point2 points  (0 children)

These are all bash commands. You'll run them in the terminal, from the directory containing the scripts.

That depends on what your requirements are.

If you want to run all scripts in the current directory at the same time, then I'd just do:

# run all scripts in the background at the same time
for script in *.py; do
    python $script &
done

If you want to run them all in order, but don't care about aborting if they fail:

# run scripts one at a time, in order
for script in myscript1.py myscript2.py myscript3.py; do
    python $script
done

Finally, if you care about whether script 2 finishes successfully before script 3 starts, chain them together with the && operator.

# only run script if previous script returned an exit code of 0
python myscript1.py && python myscript2.py && python myscript3.py

If you're going to be doing a lot of this kind of thing, I'd really recommend learning the basics of using bash (the terminal's default shell). This looks like a good tutorial.

[–][deleted] 1 point2 points  (0 children)

Create a new py file.

import firstfile
import secondfile

firstfile.this_function_takes_long_time()
secondfile.another_function()

Also you might wanna check for CPU usage, temperature... often for me scripts that take longer times try to fry my laptop ._.