<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle20
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>This might be related to <a href="https://github.com/pythonnet/pythonnet/issues/3">https://github.com/pythonnet/pythonnet/issues/3</a> (i.e. the stuff you can download from sourceforge does NOT work with .Net 4.5.1). The develop version that is on <a href="https://github.com/pythonnet/pythonnet">https://github.com/pythonnet/pythonnet</a> fixes this bug. We hope to release a beta version of this that can be installed via pip soon.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>David<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> PythonDotNet [mailto:pythondotnet-bounces+anthoff=berkeley.edu@python.org] <b>On Behalf Of </b>Jonno<br><b>Sent:</b> Thursday, March 13, 2014 6: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<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></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:<o:p></o:p></p><div><p class=MsoNormal>"dynamic module not initialized properly"<o:p></o:p></p></div><div><p class=MsoNormal>I'm on CPython 2.7.5, Win7 32bit.<o:p></o:p></p></div><div><p class=MsoNormal>Can anyone suggest what might be causing this? I have .NET Framework 4.5 installed.<o:p></o:p></p></div></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></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:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><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?<o:p></o:p></p><div><p class=MsoNormal><br>I'm not familiar with how to build the pythondotnet source.<o:p></o:p></p></div></div><div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></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:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><p class=MsoNormal>My mistake Tony,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I was using the 2.0 CLR version of pythondotnet which doesn't have the DocStringAttribute class.<o:p></o:p></p></div></div><div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></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:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><p class=MsoNormal>Hi,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></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.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>cheers,<o:p></o:p></p></div><div><p class=MsoNormal>Tony<o:p></o:p></p></div></div><div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></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:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><p class=MsoNormal>Thanks Tony,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></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:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></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?)<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I have the:<o:p></o:p></p></div><div><p class=MsoNormal>using Python.Runtime<o:p></o:p></p></div><div><p class=MsoNormal>statement.<o:p></o:p></p></div></div><div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></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:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><p class=MsoNormal>Hi,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></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.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></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><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></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).<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>cheers,<o:p></o:p></p></div><div><p class=MsoNormal>Tony<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></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:<o:p></o:p></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,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></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?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I found the following in a thread a while back but it's not working for me:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></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 ##<o:p></o:p></span></pre><pre style='line-height:14.7pt;vertical-align:baseline'><span style='font-size:9.0pt;color:#333333'>using System;<o:p></o:p></span></pre><pre style='line-height:14.7pt;vertical-align:baseline'><span style='font-size:9.0pt;color:#333333'>using System.Runtime.InteropServices;<o:p></o:p></span></pre><pre style='line-height:14.7pt;vertical-align:baseline'><span style='font-size:9.0pt;color:#333333'>using Python.Runtime;<o:p></o:p></span></pre><pre style='line-height:14.7pt;vertical-align:baseline'><span style='font-size:9.0pt;color:#333333'><o:p> </o:p></span></pre><pre style='line-height:14.7pt;vertical-align:baseline'><span style='font-size:9.0pt;color:#333333'>namespace PinvokeTest<o:p></o:p></span></pre><pre style='line-height:14.7pt;vertical-align:baseline'><span style='font-size:9.0pt;color:#333333'>{<o:p></o:p></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.")]<o:p></o:p></span></pre><pre style='line-height:14.7pt;vertical-align:baseline'><span style='font-size:9.0pt;color:#333333'>    public class Invoke {<o:p></o:p></span></pre><pre style='line-height:14.7pt;vertical-align:baseline'><span style='font-size:9.0pt;color:#333333'>             <o:p></o:p></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) <o:p></o:p></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.")]<o:p></o:p></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) {<o:p></o:p></span></pre><pre style='line-height:14.7pt;vertical-align:baseline'><span style='font-size:9.0pt;color:#333333'>                              Console.WriteLine("Writing {0}", arg);<o:p></o:p></span></pre><pre style='line-height:14.7pt;vertical-align:baseline'><span style='font-size:9.0pt;color:#333333'>                         return;<o:p></o:p></span></pre><pre style='line-height:14.7pt;vertical-align:baseline'><span style='font-size:9.0pt;color:#333333'>             }<o:p></o:p></span></pre><pre style='line-height:14.7pt;vertical-align:baseline'><span style='font-size:9.0pt;color:#333333'>    }<o:p></o:p></span></pre><pre style='line-height:14.7pt;vertical-align:baseline'><span style='font-size:9.0pt;color:#333333'>}<o:p></o:p></span></pre></div></div><p class=MsoNormal><o:p> </o:p></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><o:p></o:p></p></blockquote></div><p class=MsoNormal><o:p> </o:p></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><o:p></o:p></p></blockquote></div><p class=MsoNormal><o:p> </o:p></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><o:p></o:p></p></blockquote></div><p class=MsoNormal><o:p> </o:p></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><o:p></o:p></p></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></div></div></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></div></div></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>