pyperl -- Arrays to Lists? ...Tuples?
Tim Widowfield
taw at dnaco.net
Mon Mar 4 19:33:05 EST 2002
I hope it's not impolite to answer one's own question. I got around the
tuple problem by forgoing the PerlModule construct and using Perl more
directly. Once you've said 'import perl', 'perl.require("MyMOD")', and
then somthing like:
obj_handle = perl.callm("new", "MyMOD", params)
...you can finally say:
thingy = perl.callm_tuple("method", obj_handle, param1, param2, ...)
...and your thingy will definitely come back as a tuple.
--Tim Widowfield,
taw at dnaco.net
On Sat, 2 Mar 2002, Tim Widowfield wrote:
> Greetings:
>
> I hope I'm not missing something obvious, but here goes. I'm calling a
> Perl module from a Python script with the aid of pyperl. Pretty much
> everything works as expected, but functions with array return values keep
> giving me strings in Python. In particular, the string is the last value
> in the returned array.
>
> I've tried wrapping the function call with "tuple" and "list", but that
> only causes the string to break itself up into individual letters. How
> can I force pyperl to understand I'm expecting an array of values and not
> just a single string? Has anyone seen this before?
>
> Thanks in advance.
>
>
> --Tim Widowfield,
> taw at dnaco.net
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
More information about the Python-list
mailing list