Re: Import/Create module from buffer

2008-05-12 Thread Gabriel Genellina
En Mon, 12 May 2008 08:09:45 -0300, Gruik <[EMAIL PROTECTED]> escribió: > On May 12, 12:31 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Mon, 12 May 2008 05:49:22 -0300, Gruik <[EMAIL PROTECTED]> escribió: >> >> > I'm currently working on python embedding with C++. My goal is that >>

Re: Import/Create module from buffer

2008-05-12 Thread Gruik
On May 12, 1:48 pm, Irmen de Jong <[EMAIL PROTECTED]> wrote: > Gruik wrote: > > But before that 1 question: what if I'm in Python ? > > Following your solution, I did that in Python : > > >     def load_buffer(buffer) : > >         compiled_buffer = compile(buffer, "module_name", "exec") > >      

Re: Import/Create module from buffer

2008-05-12 Thread Irmen de Jong
Gruik wrote: But before that 1 question: what if I'm in Python ? Following your solution, I did that in Python : def load_buffer(buffer) : compiled_buffer = compile(buffer, "module_name", "exec") exec(compiled_buffer) It works great except that I can't have a module object

Re: Import/Create module from buffer

2008-05-12 Thread Gruik
On May 12, 12:31 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 12 May 2008 05:49:22 -0300, Gruik <[EMAIL PROTECTED]> escribió: > > > I'm currently working on python embedding with C++. My goal is that > > the C++ part handle files writing/reading so that the Python part only > > work

Re: Import/Create module from buffer

2008-05-12 Thread Gabriel Genellina
En Mon, 12 May 2008 05:49:22 -0300, Gruik <[EMAIL PROTECTED]> escribió: > I'm currently working on python embedding with C++. My goal is that > the C++ part handle files writing/reading so that the Python part only > works with buffers. > > I succeeded in buffer exchanges. The problem is that some

Import/Create module from buffer

2008-05-12 Thread Gruik
Hi people, I'm currently working on python embedding with C++. My goal is that the C++ part handle files writing/reading so that the Python part only works with buffers. I succeeded in buffer exchanges. The problem is that some of the files I read/write are python files so that, before embedding,