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.

2
  • I want to execute multiple python scripts concurrently. I was thinking this would be a stepping stone. Is there a better way to do? Commented Sep 15, 2022 at 7:09
  • 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 Commented Sep 16, 2022 at 8:13

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.