Cython file write

匿名 (未验证) 提交于 2019-12-03 01:41:02

问题:

  • I have a sample '.pyx' file
  • Here, certain mmap operation has been done (via C mmap) and the and 'data_len' has been returned
  • I want to read from the offset start upto the data_len area, AND dump it to a random file

I am doing this by the following: BUT, getting Syntax error while doing 'write' operation

cdef void *startmmaparea def do_dump()      offset= <char *> startmmaparea ...     with open('abc.bin','wb') as fdes:      fdes.write(offset.read(data_len))   ...

expected to write the mmap content to the file. but getting Syntax error in the 'write' op Can I write the using the read() as I have done above ? - Can anyone help me with what I am doing wrong here ?

转载请标明出处:Cython file write
文章来源: Cython file write
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!