in reply to call python from perl cause error

Hi anaconda_wly,
Assuming the python file can not be modified
Then:

  1. You might have to do ... qx/python $mycmd/; in your perl script for it to work.
  2. You will want to use system, instead of backticks and "qx//". Since your python script is redirecting the output of the program into a file named 'NUL'.
    But if what you want is output in your array "@res", then you might have to modify your python script not to 'redirect' using backtick or 'qx//' like you did.
  3. Using your python script on linux OS, since I don't have a Win OS to try it on. Will make the script run almost forever unless the "ping" command in the python script is given a "count" like so: .. "ping -c 10 127.0.0.1 > NUL".

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me