Chris Nighswonger
2013-04-01 16:57:19 UTC
I seem to be misunderstanding something about importing Python package vars
with Inline. I'm thinking it may be some syntax problem.
This code returns the value of __version__ as expected:
use Inline Python => "from pykota.version import __version__; print
__version__;";
However, this code borks:
use Inline Python => 'DATA',
DIRECTORY => '/usr/share/webmin/pykota/.Inline/',
NAME => 'PyKota::Test';
print pykota_version();
1;
__DATA__
__Python__
def pykota_version():
from pykota.version import __version__
return __version__
The error is:
File "<string>", line 3
from pykota.version import
^
SyntaxError: invalid syntax
Error -- py_eval raised an exception at
/usr/local/lib/perl/5.14.2/Inline/Python.pm line 177.
INIT failed--call queue aborted.
Kind Regards,
Chris
with Inline. I'm thinking it may be some syntax problem.
This code returns the value of __version__ as expected:
use Inline Python => "from pykota.version import __version__; print
__version__;";
However, this code borks:
use Inline Python => 'DATA',
DIRECTORY => '/usr/share/webmin/pykota/.Inline/',
NAME => 'PyKota::Test';
print pykota_version();
1;
__DATA__
__Python__
def pykota_version():
from pykota.version import __version__
return __version__
The error is:
File "<string>", line 3
from pykota.version import
^
SyntaxError: invalid syntax
Error -- py_eval raised an exception at
/usr/local/lib/perl/5.14.2/Inline/Python.pm line 177.
INIT failed--call queue aborted.
Kind Regards,
Chris