in reply to Proper usage of Inline::Python
Here's a concrete example that worked for me, using the Decimal class. I expect the usage to be analogous for the Hyperdex library. As Anony-Monk pointed out, the do-it-yourselfer's guide is valuable documentation here.
use Inline::Python qw(py_eval py_call_function); py_eval("import decimal"); my $d1 = Inline::Python::Object->new('decimal', 'Decimal', '42.00'); my $d2 = Inline::Python::Object->new('decimal', 'Decimal', '2.00'); my $d3 = $d1->__mul__($d2); print $d3->to_eng_string(); # prints "84.000"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Proper usage of Inline::Python
by OverlordQ (Hermit) on Oct 12, 2014 at 10:01 UTC | |
by crashtest (Curate) on Oct 12, 2014 at 18:13 UTC | |
by OverlordQ (Hermit) on Oct 14, 2014 at 14:22 UTC |