From j.strecha at gmail.com Fri Apr 5 08:21:24 2019 From: j.strecha at gmail.com (Johannes Strecha) Date: Fri, 5 Apr 2019 14:21:24 +0200 Subject: [Python.NET] Restrictions on assembly names Message-ID: Dear list, I'm having trouble to import assemblies with certain names. I found it impossible to import assemblies named "Library", and I cannot import arbitrarily named assemblies that live in a subfolder having the same name as the assembly. Here are some details of a working configuration (MWE): mylib.cs: > namespace mylib { > public static class mylibClass { > public static double DoubleThis (double x) => x*2; > } > } mylib.csproj: > > > > AnyCPU > Library > bin\ > TRACE;DEBUG > > > > > > build with "msbuild mylib.csproj", copy the .dll from the bin directory to the python script (avoid modifying the path). Python (3.6.6 from Anaconda): > clr.AddReference('mylib') > import mylib > print(mylib) > print(mylib.mylibClass.DoubleThis(3)) This will print "" and "6.0". When I name everything "Library" instead of mylib, or put mylib.dll in a directory called 'mylib', the import works, but the module doesn't contain any symbols/attributes. (In the latter case, I use clr.AddReference('mylib/mylib'), of course.) Then, print(mylib) or print(Library) prints "", the main difference being the added "(namespace)". The imported module is empty, calls to something in the assembly raise an AttributeError (e.g. "...has no attribute LibraryClass"). Is this a known limitation? Should I post a bug report? Are there any other restrictions I should know about? Thank you for considering. Regards, J.St. -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.darestani at crouse.ir Sun Apr 21 07:31:03 2019 From: a.darestani at crouse.ir (Amin Darestani) Date: Sun, 21 Apr 2019 11:31:03 +0000 Subject: [Python.NET] To use python in .NET for multitasking purposes Message-ID: <624bb43674c840bea7e93f950f505f40@crouse.ir> Hello, I Have designed a .net Project which uses a python file in itself and I need to implement Multitasking in my .Net Project because of speeding up the execution. I use Task Parallel Library in C# and I call python file by Process in each task but It doesn't speed up my application and multitasking is not implemented correctly. So I need to use python script in my task directly to speed up my application. Would you please help me to find a solution to use maximum power of my CPU to do my pattern recognition project faster? Best Regards [cid:image001.jpg at 01D15D05.168687B0] Drive with Quality Amin Darestani Software Engineer No. 253, 11th km of Karaj Makhsoos Rd., Tehran, 13998-13411, IRAN. Tel: +98 21 44 90 81 40 - 7 (Ext.: xxxx ) Fax: +98 21 44 90 81 48 Mobile: +98 936 737 71 45 Email: a.darestani at crouse.ir Website: www.crouse.ir [cid:image002.jpg at 01D15D05.168687B0] Member of TOP 100 Iranian Companies Ranked 41 in 2018 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 2326 bytes Desc: image001.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 1906 bytes Desc: image002.jpg URL: