Hi again,
On 18 November 2016 at 09:40, Alexander M. <
skug...@gmail.com> wrote:
> Yes, but this doesn't work, because the argument is a str object an the
> function only accepts a char pointer.
Ah, a Python 3 question then. The problem is then that you need a
"bytes" and not a unicode "str". You don't need ffi.new() at all;
it's unrelated to cffi. You need to encode the unicode string into
the suitable encoding, and "utf-8" is a good guess. If you need more
info, search for "bytes versus unicode strings in Python 3". Then you
simply write:
lib.function(arg1, sys.argv[1].encode("utf-8"))
A bientôt,
Armin.