Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #98464 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2015-11-09 03:17 +1100 |
| Last post | 2015-11-09 03:17 +1100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: how to copy PyObject * memory data to another memory address? Chris Angelico <rosuav@gmail.com> - 2015-11-09 03:17 +1100
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2015-11-09 03:17 +1100 |
| Subject | Re: how to copy PyObject * memory data to another memory address? |
| Message-ID | <mailman.138.1446999430.16136.python-list@python.org> |
On Sun, Nov 8, 2015 at 12:23 AM, yueyoum <yueyoum@gmail.com> wrote: > I'm working on a C program that has Python embedded. The host program is multi processes, which communicate via shared memory (mmap). I create a Python object (e.g., PyDict_New) in one process. How can I copy this data to shared memory so that the other process can obtain this data and convert to Python Object? 发自网易邮箱大师 > The best way to do this would be to serialize it in some format - JSON is a good choice, if all your data can fit into that format; otherwise, consider the Pickle format. Python objects consist of lots of references to other objects, so it's difficult to transfer them from one to another as they are. JSON will serve you well. ChrisA
Back to top | Article view | comp.lang.python
csiph-web