Are you running Bookwork and using Python's virtual environment (VENV)? If so, then you need to run the subproces so that it activates and runs inside of it.If I run 12345.py separately, it works as expected. Why does the LED not start blinking when 12345.py is run as a subprocess inside of barcodeTest1.py?
Python has not done a lot of documentation on this. This simplest is to create a BASH file and run it. I found this example at https://bktapan.medium.com/how-to-sched ... bd6fcaa56a
Code:
#!/bin/bash# cd /home/mypc/awesomeproject# source venv/bin/activate# python myawesomepythonscript.pyCode:
import subprocess cmd = 'source activate my_virtualenv; python my_script.py'subprocess.call(cmd, shell=True, executable='/bin/bash'))Statistics: Posted by DS256 — Fri Nov 15, 2024 8:30 pm