OK so im trying to get exec()
to execute a script that works fine from idle.
If I try a simple script it works fine, such as:
hello = "hello"
world = "world"
print hello + " " + world
But the script I actually want to run wont work and I can only assume its because of the module import, the code is as follows:
import serial
port = serial.Serial('/dev/ttyAMA0', baudrate=19200, bytesize=8, parity=serial.PARITY_NONE, stopbits=1, timeout=5)
port.open
port.write("\x02\x00\x00\x00\x00\x02")
My PHP code is:
<?php
$result = exec('python python.py');#This works fine
echo $result
?>
<?php
$result1 = exec('python proOn.py');# This wont work
echo $result1
?>