'How to make a developed perl package with a python wrapper callable from everywhere
A bit of context:
I have a Perl parser, named parse_log.pl, that parses logs into a .m file (MATLAB function). In the .m file, the logs are stored into a MATLAB struct which is the output of the function. This function can then be called from MATLAB so the struct (logs) becomes available in the command window.
The Perl parser uses two packages, LogAParser.pm and LogBParser.pm which I put into a directory LogParserPackage and the main log parser function, parse_log.pl uses the subs in these packages based on the command line arguments to parse a specific log.
In order to save the logs (struct) into a ‘mat’ file, I developed a Python wrapper for this Perl parser in which I use matlab.engine in order to save the mat file as a mat v7.3 file and benefit from its compression capability.
Questions:
- How to make this python/Perl module callable from everwhere in the shell (something like setup).
- In the Python wrapper, how to check if the
matlab.engineis installed on the user’s machine? Same question for Perl? And in case if they are not installed, how throw an exception with an informative message?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
