简体   繁体   中英

Running Python scripts from Perl scripts

I have a complex state machine in Perl which would be call the perl library module supporting different functionality. Each of the library modules are called sequentially based on state machine in perl.

But now I have one of the library module (consisting of many API) in python scripts which is needs to be called from perl state machine.

Please suggest me as to how can I call the sub-routines in python from the perl state-machine.

There is an Inline::Python on CPAN, but personally I have been unable to get that to work. Other than that, you can't. You will need to create a wrapper script (in Python) which does the calls you need and call that as a separate process. Depending on how the app is structured, you might have to pass data through some language neutral IPC mechanism like sockets or pipes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM