Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: call python from perl cause error

by 2teez (Vicar)
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2018-06-20 04:32 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (116 votes). Check out past polls.