I am as new as can be to python.
I am trying to run one python script from within another.
The first script is drcontrol.py wich is a basic script for operating a USB 8 relay board.
An example of using this from the command line would be:
the -d term is the serial number of the board
Code: Select all
python drcontrol.py -d DAE003zi -r 1 -c on
the -r term is the relay which is to be controlled
the -c term is the control action
So the above would turn relay 1 on.
The script works quite happily when run as above.
In order to interface the board with Cayenne, I am writing a parent script to run drcontrol.py. I'll call this parent script ircontrol.py.
All I want it to do is run the same as above, changing the -r and -c term depending on the Cayenne interface input.
Most of that I can figure out, however I am stuck at getting the ircontrol.py script to run the drcontrol.py script with the all the additional arguments (if this is the correct term for the -d, -r and -c terms?).
Can anyone give me a starter on this?