For some reason, when I try to add the following line of code, I get an error:
p = subprocess.Popen("df -Pk -m -xtmpfs -xdevtmpfs", stdout=PIPE, shell=True).stdout
I initially had code that used os instead, but that didn't work either.
As the code runs fine in the Interactive Shell, the only thing I could think of is that I'm importing the module incorrectly. I'm not entirely sure where this script is running from, but I'm importing normally with:
import os
import subprocess
from subprocess import Popen, PIPE, STDOUT
Should I try moving the modules to a different folder such as the paepy folder? Is it actually an import issue?
Also, I always get the PE233 error no matter what, syntax error, return error, print error. Does that hold some significance?
Dear justinkae
Since the import fails, no correct output is generated, hence the error. PRTG uses its own Python runtime ("C:\Program Files (x86)\PRTG Network Monitor\Python34"). Did you put the modules into the right place?
Jul, 2017 - Permalink