On Tuesday 12 March 2013 11:15:40 Chris Nighswonger wrote:
> On Tue, Mar 12, 2013 at 9:43 AM, Stefan Seifert <n...@detonation.org> wrote:
> > # create a Python foo.Bar object and make it look like a Bar object in
> > Perl:
> > my $bar = py_new_object('Bar', 'foo', 'Bar', 'constructor arg 1');
> > $bar->baz();
> 
> So here's my shot at this:
> 
> use Inline::Python qw( py_new_object );
> 
> my $pykota_conf = py_new_object("config", "pykota.config", "PyKotaConfig",
> '/etc/pykota/');
> print "Admin mail for the AP400N: " . $pykota_conf->getAdminMail('AP400N')
> . "\n";

You're missing the import statement. It's still neccessary for Python to load 
the package. Try:

use Inline::Python qw( py_new_object );
use Inline::Python => <<'PYTHON';
    import pykota.config
PYTHON

my $pykota_conf = py_new_object("config", "pykota.config", "PyKotaConfig",
'/etc/pykota/');
print "Admin mail for the AP400N: " . $pykota_conf->getAdminMail('AP400N')
. "\n";


Regards,
Stefan

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to