In cpp it would be like:
import('sys').attr('modules')['mymodule'].del()
Thank you, it worked. However, I believe it would only remove one
module, not any other module imported. I tried to clear the dictionnary,
which worked in Python, i didn't achieve to reproduce this in c++.
Anyway, this w
You can remove one reference from the sys module:
Import sys
del sys.modules['mymodule']
In cpp it would be like:
import('sys').attr('modules')['mymodule'].del()
I can give you my code later. Don't have it here!
// Simon
On 1 aug 2011, at 13:38, Valentin Perrelle wrote:
> Le 01/08/2011 13:19
Le 01/08/2011 13:19, Simon Warg a écrit :
In My program I need to unload modules as well. What I do is remove all
references to the particular module and it will be unloaded.
It seems i didn't achieve to do that. There should be some references i
can't remove, i don't know why yet.
Are you
In My program I need to unload modules as well. What I do is remove all
references to the particular module and it will be unloaded.
Are you using boost python for python 2 or 3? If it's the latter it is safe to
use Py_Finalize()! I use it myself!
// Simon
On 1 aug 2011, at 12:58, Valentin Per
You could use the reload() function in python 2.7 or imp.reload() in python 3.
It takes a module object as argument.
Thanks. However it wouldn't reset to the initial state in the general
case. All modules needs to be unloaded. I don't know a safe way to it
yet. I'm just sure i want to do it i
You could use the reload() function in python 2.7 or imp.reload() in python 3.
It takes a module object as argument.
// Simon
On 1 aug 2011, at 12:00, Valentin Perrelle wrote:
>
>> All of that sounds sounds. But at what point were you trying to register a
>> to-python converter? It sounded
All of that sounds sounds. But at what point were you trying to
register a to-python converter? It sounded like you were trying to do
that before importing the module, and since a to-python converter is
by definition C++, I didn't understand how you could do it in a Python
script before imp
On 07/31/2011 12:52 AM, Valentin Perrelle wrote:
Le 31/07/2011 07:38, Jim Bosch a écrit :
I guess I don't really understand how your program flow is supposed to
work - how did you plan to invoke C++ code from Python before
importing your Boost.Python module? Usually the natural place to
register
Le 31/07/2011 07:38, Jim Bosch a écrit :
I guess I don't really understand how your program flow is supposed to
work - how did you plan to invoke C++ code from Python before
importing your Boost.Python module? Usually the natural place to
register converters is during module import after you'v
On 07/30/2011 03:18 PM, Valentin Perrelle wrote:
Thanks to you, I know understand some points i couldn't catch reading
the manual 3-4 times. I'm now able to fix the current problem by
importing my module before assigning the variable 'keyboard'. Which
leads me to another question : is there a way
Thank you for your answer.
> Why do you think you can't have noncopyable?
I understood it prevents the registration of converters for the class. I
just read the manual again and now i understand it only remove converter
which copy instances, i.e. conversion of values.
Anyhow, I'd recommend
On 07/30/2011 01:15 PM, Valentin Perrelle wrote:
Hi,
I'm currently embedding and extending Python using Boost.Python. I'm
trying to expose some c++ library (OIS) classes to my Python scripts.
This library mainly exposes abstract classes since the actual
implementation are derived classes special
12 matches
Mail list logo