I'd like to use a subprocess in a Python program that runs on a Raspberry Pi Pico board. When I try a simple test example:
in: main_program.py
import subprocess
def run_script():
print("Running the script...")
subprocess.run(["python", "other_script.py"])
print("Execution completed.")
if __name__ == "__main__":
run_script()
print("Back in the main program.")
in: other_script.py:
print("Hello from the other script.")
I get this error message from Thonny:
MPY: soft reboot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'subprocess'
Any suggestions? Thank you. --Jon