[Python.NET] import Python module in C# - multiple instances, not global/static for the class

Denis Akhiyarov denis.akhiyarov at gmail.com
Mon Oct 6 15:45:13 CEST 2014


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:

using (Py.GIL())
            {
                dynamic syspy = Py.Import("sys");
                syspy.path.append(ConfigDirectory);
                mymodulepy= Py.Import("mymodulepy");
            }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythondotnet/attachments/20141006/698322a4/attachment-0001.html>


More information about the PythonDotNet mailing list