<div dir="ltr">I tried with VS2012 closed but it didn't help me.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 13, 2014 at 11:25 AM, John Gill <span dir="ltr"><<a href="mailto:jgill@tokiomillennium.com" target="_blank">jgill@tokiomillennium.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I occasionally get this error on import of clr.   Usually when I have Visual Studio open.   Closing VS and retrying has always solved the issue up to now.<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">John<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> PythonDotNet [mailto:<a href="mailto:pythondotnet-bounces%2Bjgill" target="_blank">pythondotnet-bounces+jgill</a>=<a href="mailto:tokiomillennium.com@python.org" target="_blank">tokiomillennium.com@python.org</a>]
<b>On Behalf Of </b>Jonno<br>
<b>Sent:</b> Thursday, March 13, 2014 10:57 AM<br>
<b>To:</b> A list for users and developers of Python for .NET<br>
<b>Subject:</b> Re: [Python.NET] DocStringAttribute Example<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Also when using clr.pyd from pythonnet-2.0-Beta0-clr4.0_140_py27_UCS2_x86.zip I cannot import clr. I get the following error:<u></u><u></u></p>
<div>
<p class="MsoNormal">"dynamic module not initialized properly"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">I'm on CPython 2.7.5, Win7 32bit.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Can anyone suggest what might be causing this? I have .NET Framework 4.5 installed.<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Wed, Mar 12, 2014 at 2:33 PM, Jonno <<a href="mailto:jonnojohnson@gmail.com" target="_blank">jonnojohnson@gmail.com</a>> wrote:<u></u><u></u></p>
<div>
<p class="MsoNormal">Is it possible to compile the 2.0 Beta version containing the DocStringAttribute for clr version 2.0 or is there some incompatibility?<u></u><u></u></p>
<div>
<p class="MsoNormal"><br>
I'm not familiar with how to build the pythondotnet source.<u></u><u></u></p>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Wed, Mar 12, 2014 at 11:59 AM, Jonno <<a href="mailto:jonnojohnson@gmail.com" target="_blank">jonnojohnson@gmail.com</a>> wrote:<u></u><u></u></p>
<div>
<p class="MsoNormal">My mistake Tony,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I was using the 2.0 CLR version of pythondotnet which doesn't have the DocStringAttribute class.<u></u><u></u></p>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Wed, Mar 12, 2014 at 9:46 AM, Tony Roberts <<a href="mailto:tony@pyxll.com" target="_blank">tony@pyxll.com</a>> wrote:<u></u><u></u></p>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">have you added the Python.Runtime to your project references? Take a look at the Python.Test project that's used by the unit tests if you're not sure how to set up your project.<u></u><u></u></p>

</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">cheers,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Tony<u></u><u></u></p>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Wed, Mar 12, 2014 at 2:33 PM, Jonno <<a href="mailto:jonnojohnson@gmail.com" target="_blank">jonnojohnson@gmail.com</a>> wrote:<u></u><u></u></p>
<div>
<p class="MsoNormal">Thanks Tony,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">This is probably my ignorance of C# but I get the following error using the same syntax as the example:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">The type or namespace name 'DocStringAttribute' could not be found (are you missing a using directive or an assembly reference?)<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I have the:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">using Python.Runtime<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">statement.<u></u><u></u></p>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Fri, Mar 7, 2014 at 12:19 PM, Tony Roberts <<a href="mailto:tony@pyxll.com" target="_blank">tony@pyxll.com</a>> wrote:<u></u><u></u></p>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">if your class has a constructor then the class docstring will get replaced with a description of the constructor, even if you explicitly gave the class a docstring using DocStringAttribute.<u></u><u></u></p>

</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I've created an issue for github for this and fixed it: <a href="https://github.com/pythonnet/pythonnet/issues/14" target="_blank">https://github.com/pythonnet/pythonnet/issues/14</a><u></u><u></u></p>

</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">In the same commit I added some unit tests which should do as an example for you to see how it should work (see the newly added file pythonnet/src/testing/doctest.cs and pythonnet/src/tests/test_docstring.py).<u></u><u></u></p>

<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">cheers,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Tony<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<div>
<div>
<p class="MsoNormal">On Wed, Mar 5, 2014 at 3:59 PM, Jonno <<a href="mailto:jonnojohnson@gmail.com" target="_blank">jonnojohnson@gmail.com</a>> wrote:<u></u><u></u></p>
</div>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Is there an example how to format documentation in classes & methods so that a python docstring will be produced?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I found the following in a thread a while back but it's not working for me:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<pre style="line-height:14.7pt;vertical-align:baseline;outline:0px;white-space:pre-wrap;word-wrap:break-word"><span style="font-size:9.0pt;color:#333333">### test.cs ##<u></u><u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333">using System;<u></u><u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333">using System.Runtime.InteropServices;<u></u><u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333">using Python.Runtime;<u></u><u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333"><u></u> <u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333">namespace PinvokeTest<u></u><u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333">{<u></u><u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333">       [DocStringAttribute("Interface class to external functions.")]<u></u><u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333">       public class Invoke {<u></u><u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333">               <u></u><u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333">               [DocStringAttribute("External funtion simulation: WriteToFile(char) <u></u><u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333">will write a char to the terminal.")]<u></u><u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333">               public static void WriteToFile(char arg) {<u></u><u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333">                        Console.WriteLine("Writing {0}", arg);<u></u><u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333">                         return;<u></u><u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333">               }<u></u><u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333">       }<u></u><u></u></span></pre>
<pre style="line-height:14.7pt;vertical-align:baseline"><span style="font-size:9.0pt;color:#333333">}<u></u><u></u></span></pre>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<p class="MsoNormal">_________________________________________________<br>
Python.NET mailing list - <a href="mailto:PythonDotNet@python.org" target="_blank">
PythonDotNet@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pythondotnet" target="_blank">https://mail.python.org/mailman/listinfo/pythondotnet</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal"><br>
_________________________________________________<br>
Python.NET mailing list - <a href="mailto:PythonDotNet@python.org" target="_blank">
PythonDotNet@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pythondotnet" target="_blank">https://mail.python.org/mailman/listinfo/pythondotnet</a><u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
<p class="MsoNormal"><br>
_________________________________________________<br>
Python.NET mailing list - <a href="mailto:PythonDotNet@python.org" target="_blank">
PythonDotNet@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pythondotnet" target="_blank">https://mail.python.org/mailman/listinfo/pythondotnet</a><u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
<p class="MsoNormal"><br>
_________________________________________________<br>
Python.NET mailing list - <a href="mailto:PythonDotNet@python.org" target="_blank">
PythonDotNet@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pythondotnet" target="_blank">https://mail.python.org/mailman/listinfo/pythondotnet</a><u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
<p style="MARGIN:0in 0in 10pt" class="MsoNormal"><font face="Calibri">This communication and any attachments contain information which is confidential and may also be legally privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of disclosure, distribution, copying, printing or use of this communication or the information in it or in any attachments is strictly prohibited and may be unlawful. If you have received this communication in error, please return it with the title "received in error" to <a href="mailto:postmaster@tokiomillennium.com" target="_blank">postmaster@tokiomillennium.com</a> and then permanently delete the email and any attachments from your system.</font></p>
<p style="MARGIN:0in 0in 10pt" class="MsoNormal"></p><p><font face="Calibri"> </font></p><p></p><p style="MARGIN:0in 0in 10pt" class="MsoNormal"><font face="Calibri">E-mail communications cannot be guaranteed to be secure or error free, as information could be intercepted, corrupted, amended, lost, destroyed, arrive late or incomplete, or contain viruses. It is the recipient's responsibility to ensure that e-mail transmissions and any attachments are virus free. We do not accept liability for any damages or other consequences caused by information that is intercepted, corrupted, amended, lost, destroyed, arrives late or incomplete or contains viruses.</font></p>
<p style="MARGIN:0in 0in 10pt" class="MsoNormal"><font face="Calibri">******************************************</font></p><p>
</p></div>

<br>_________________________________________________<br>
Python.NET mailing list - <a href="mailto:PythonDotNet@python.org">PythonDotNet@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pythondotnet" target="_blank">https://mail.python.org/mailman/listinfo/pythondotnet</a><br></blockquote></div><br></div>