Huyen
Huyen

Reputation: 533

Run 2 python scripts in Google Colab

I'm using GPU on Google Collab. How can I run 2 python scripts simultaneously to get a continuous evaluation for my data? I have tried

!python script1.py &
!python script2.py &

but it didn't work.

Thanks in advance!

Upvotes: 5

Views: 4341

Answers (2)

Neb
Neb

Reputation: 2280

You can use the built-in magic %%bash as first line in your cell:

%%bash

python script1.py &
python script2.py &

Upvotes: 0

Mudit Verma
Mudit Verma

Reputation: 394

I've not tried this yet, however, with ipython you can run a python script simply as

run myscript.py

Upvotes: 2

Related Questions