<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=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 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;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</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=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>The last line should probably be:<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><span style='font-size:11.0pt;color:#1F497D'>cmdLine.Run(Python.CreateEngine(),
IronPythonWrapper(), PythonConsoleOptions())</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I thought IronPythonWrapper was an instance but it looks like it’s
a type – so it needs to be constructed.<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>
<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<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"'>
users-bounces@lists.ironpython.com [mailto:users-bounces@lists.ironpython.com] <b>On
Behalf Of </b>Andrew Evans<br>
<b>Sent:</b> Wednesday, May 06, 2009 5:24 PM<br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> Re: [IronPython] Compiling IronPythonConsole.exe<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'>Hello Ive tried implementing
what you suggested with no success<br>
<br>
I have attached the source just in case you or anyone can shed some light on it<br>
<br>
Cheers<br>
<br>
>>> import readline<br>
Traceback (most recent call last):<br>
File "<stdin>", line 1, in <module><br>
File "C:\Users\Can IT\Desktop\readline.py", line 4, in
C:\Users\Can IT\Desktop<br>
\readline.py<br>
File "C:\Python25\Lib\site-packages\pyreadline\__init__.py",
line 9, in C:\Pyt<br>
hon25\Lib\site-packages\pyreadline\__init__.py<br>
File "C:\Python25\Lib\site-packages\pyreadline\rlmain.py",
line 477, in C:\Pyt<br>
hon25\Lib\site-packages\pyreadline\rlmain.py<br>
File
"C:\Python25\Lib\site-packages\pyreadline\console\ironpython_console.py",<br>
line 408, in install_readline<br>
TypeError: expected IConsole, got type<br>
>>><br>
<br>
<br>
<br>
<o:p></o:p></p>
<div>
<p class=MsoNormal>On Wed, May 6, 2009 at 2:48 PM, Dino Viehland <<a
href="mailto:dinov@microsoft.com">dinov@microsoft.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p><span style='font-size:11.0pt;color:#1F497D'>This one’s a little more
complex. It looks like there’s no longer a writable IConsole
property. Instead it looks like you need to create a PythonCommandLine
object and then pass in a ScriptEngine, an IConsole, and a ConsoleOptions
object. That’d look something like:</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>import clr</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>clr.AddReference(‘IronPython’)</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>clr.AddReference(‘Microsoft.Scripting’)</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>from IronPython.Hosting import
PythonCommandLine, PythonConsoleOptions, Python</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>cmdLine = PythonCommandLine()</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>cmdLine.Run(Python.CreateEngine(),
IronPythonWrapper, PythonConsoleOptions())</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>When you call Run here that
will then start the interactive interpreter loop – I’m not sure if that’s exactly
what you want. This is also going to create a 2<sup>nd</sup> IronPython
engine because you can’t really get to the current ScriptEngine from within
IronPython itself – again there could be reasons why you wouldn’t want this to
happen.</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>If you’ve got suggestions on
what you’d like the APIs to look like for this scenario let us know </span><span
style='font-size:11.0pt;font-family:Wingdings;color:#1F497D'>J</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<div style='border:none;border-left:solid windowtext 1.5pt;padding:0in 0in 0in 4.0pt;
border-color:-moz-use-text-color -moz-use-text-color -moz-use-text-color blue'>
<div>
<div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;
border-color:-moz-use-text-color -moz-use-text-color'>
<p><b><span style='font-size:10.0pt'>From:</span></b><span style='font-size:
10.0pt'> <a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a>
[mailto:<a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a>]
<b>On Behalf Of </b>Andrew Evans<br>
<b>Sent:</b> Wednesday, May 06, 2009 1:36 PM<o:p></o:p></span></p>
<div>
<p class=MsoNormal><span style='font-size:10.0pt'><br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> Re: [IronPython] Compiling IronPythonConsole.exe<o:p></o:p></span></p>
</div>
</div>
</div>
<p> <o:p></o:p></p>
<p style='margin-bottom:12.0pt'>Hello<o:p></o:p></p>
<div>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'><br>
<br>
pyreadline plays an important part in scapy (<a
href="http://www.secdev.org/projects/scapy/" target="_blank">http://www.secdev.org/projects/scapy/</a>)
which is what I am porting to IronPython. My reason for this is well I like a
challenge. That's the only reason as self serving as that may seem :-P<br>
<br>
Thats the result of my console<br>
<br>
Welcome to Scapy (1.2.0.2-win)<br>
☺←[34m←[1m☻>>> ☺←[0m☻<br>
<br>
<br>
I am not 100 % sure I implented this line correct<br>
<br>
"MyConsole = IronPythonWrapper()"<br>
<br>
which was previously<br>
<br>
IronPythonConsole.PythonCommandLine.MyConsole = IronPythonWrapper()<br>
<br>
maybe more experienced people can shed a light on this<br>
<br>
when that is solved I can submit a patch :-) I would be happy to<br>
<br>
<o:p></o:p></p>
</div>
</div>
<div>
<div>
<div>
<p>On Wed, May 6, 2009 at 1:20 PM, Jörgen Stenarson <<a
href="mailto:jorgen.stenarson@bostream.nu" target="_blank">jorgen.stenarson@bostream.nu</a>>
wrote:<o:p></o:p></p>
<p>Andrew Evans skrev:<o:p></o:p></p>
<div>
<blockquote style='border:none;border-left:solid windowtext 1.0pt;padding:0in 0in 0in 6.0pt;
margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt;
border-color:-moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(204, 204, 204)'>
<p> <o:p></o:p></p>
<p style='margin-bottom:12.0pt'>Hey Stephen thank you<br>
<br>
You solved my problem (I had copied pyreadline from previously to the
ironpython folder.) I modified the file in the ironpython folder...
modifying it in the default directory in C:\Python25 fixed it<br>
<br>
Thank You :-)<o:p></o:p></p>
</blockquote>
<p> <o:p></o:p></p>
</div>
<p>Andrew,<br>
<br>
I'm happy to see that someone is trying to use pyreadline (I'm the maintainer
of pyreadline) on ironpython. I have not tried it myself for a long time so I
have no idea how much bitrot has crept into it. If you have any patches to make
it work out of the box I would be happy to include it.<br>
<br>
Please file any patches via the bugtracker:<br>
<a href="https://bugs.launchpad.net/pyreadline" target="_blank">https://bugs.launchpad.net/pyreadline</a><br>
<br>
We use the ipython lists to discuss pyreadline<br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-user" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-user</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<span style='color:#888888'><br>
<br>
/Jörgen</span><o:p></o:p></p>
<div>
<div>
<p><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com"
target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><o:p></o:p></p>
</div>
</div>
</div>
<p> <o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com"
target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><o:p></o:p></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</div>
</body>
</html>