0
如何將由Python加載的二進制數據直接從文件傳遞到C++函數,並獲取Cython模塊中調用的數據指針和大小?從Python文件讀取二進制數據並將其傳遞給C++函數
loadFromMemory(const void*, size_t)
這大概是它會怎樣看行純Python:
with open('file.bin', 'rb') as f:
data = f.read()
loadFromMemory(data, len(data)) # How to do this in Cython?