Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: call python from perl cause error

by 2teez (Priest)
on Aug 09, 2013 at 08:56 UTC ( #1048714=note: print w/replies, xml ) Need Help??

in reply to call python from perl cause error

Hi anaconda_wly,
Assuming the python file can not be modified

  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 > 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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1048714]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2016-10-24 00:40 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (302 votes). Check out past polls.