KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
My first post so please take at easy. :) I'm a bit new to Python as well, but I like what I see so far. What I'm trying to do is access a c library that allows me to print to a receipt printer via Python. I'm creating a wrapper in Python using ctypes, and everything is going great, EXCEPT for two functions. Here our their prototypes: int C56_api_printer_write(int printer, unsigned char * data, int size, unsigned long timeout_ms); int C56_api_printer_read(int printer, unsigned char * data, int size, unsigned long timeout_ms); My issue is with writing to and reading from unsigned char pointers using ctypes. I have to read in a bitmap file in Python and pass the array to the write function, or in the case of read, I need to read that pointer in as an integer array. I've been floundering on this one for the past few hours, so I was hoping an expert could help by posting a simple example of how this could be accomplished. Thank you!
Tags (comma-separated)
Save Edits
Cancel