NiLuJe / py-fbink

Python cFFI bindings for FBInk
GNU General Public License v3.0
15 stars 4 forks source link

FBInk.fbink_print_ot(fbfd, b + s.c_str(), fbink_ot_cfg, fbink_cfg, ffi.NULL) #1

Closed a442509097 closed 1 year ago

a442509097 commented 1 year ago
def printString(s):
            FBInk.fbink_print_ot(fbfd, b + s.c_str(), fbink_ot_cfg, fbink_cfg, ffi.NULL)

what does b mean and how to make it work?

a442509097 commented 1 year ago

ok, is bytes type.

temp = bytes("123", encoding='utf-8')
FBInk.fbink_print_ot(fbfd, temp, fbink_ot_cfg, fbink_cfg, ffi.NULL)
NiLuJe commented 1 year ago

Context would have been helpful, as I have no idea where this code is from ;).

And, yes, it's a const char*, which makes that a bytes object on Python 3.