0

I am trying to run Test.py using os.system(path) where I specify the path of the file but I am getting an error. Basically, I want to run Test.py from here and display the output.

import os

os.system(rf"C:\\Users\\USER\\OneDrive-Technion\\Research_Technion\\Python_PNM\\Sept15_2022\\220\\1\\Test.py")

The error is

The system cannot find the path specified.

1 Answer 1

1

you are passing a python file, not an executable. You can pass python yourfile.py.

By the way, I would reconsider what you are doing, executing a python script from another python script is quite strange.

Sign up to request clarification or add additional context in comments.

2 Comments

I want to execute multiple python scripts concurrently. I was thinking this would be a stepping stone. Is there a better way to do?
sure, import your python module and run the functions you need. To achieve parallelism there are several way, e.g. docs.python.org/3/library/multiprocessing.html

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.