<div dir="ltr">After some thinking, the better solution is to wrap the python code into a class, so that each appropriate instance is called from C# side.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 6, 2014 at 8:45 AM, Denis Akhiyarov <span dir="ltr"><<a href="mailto:denis.akhiyarov@gmail.com" target="_blank">denis.akhiyarov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Is there any way to import the same Python module as multiple instances, e.g. for each instance of C# class/object? For now it looks like the same module is imported for each instance of C# object (essentially a static Python object) when I do this:<div><br></div><div><div>using (Py.GIL())</div><div>            {</div><div>                dynamic syspy = Py.Import("sys");</div><div>                syspy.path.append(ConfigDirectory);</div><div>                mymodulepy= Py.Import("mymodulepy");</div><div>            }</div></div><div><br></div></div>
</blockquote></div><br></div>