Where can I find the docs on this <br><br>I am not the best coder but maybe the documentation will help me to understand what your saying<br><br>*cheers<br><br>What I understand I need to create the function "get_Output" "set_Output" etc but in order for them to return the values would it be<br>
<br>def set_Output():<br> set_Output<br><br>Anyway once again thank you<br><br>btw it isn't my code its a IronPython module I need to work :-)<br><br><br><br><div class="gmail_quote">On Wed, May 6, 2009 at 7:12 PM, Dino Viehland <span dir="ltr"><<a href="mailto:dinov@microsoft.com">dinov@microsoft.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Ahh, I see, there’s new properties on IConsole to get/set the
Output/ErrorOutput TextWriters. You can define get_Output/set_Output/get_ErrorOutput/set_ErrorOutput
methods to implement them for the interface on IronPythonWrapper. </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">They can simply save/return the values and you can ignore it or
you can use the TextWriter to pick up when the user redirects sys.stdout/sys.stderr.</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; border-width: medium medium medium 1.5pt; padding: 0in 0in 0in 4pt;">
<div>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">
<p><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> <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 7:01 PM<div><div></div><div class="h5"><br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> Re: [IronPython] Compiling IronPythonConsole.exe</div></div></span></p>
</div>
</div><div><div></div><div class="h5">
<p> </p>
<p style="margin-bottom: 12pt;">hmm I did a search through the
code there is no set_Output and I searched Output and set_ as separate search
nothing... Now I am confused<br>
<br>
Anyway I really appreciate your help :-)<br>
<br>
*cheers<br>
<br>
Andrew</p>
<div>
<p>On Wed, May 6, 2009 at 6:32 PM, Dino Viehland <<a href="mailto:dinov@microsoft.com" target="_blank">dinov@microsoft.com</a>> wrote:</p>
<div>
<div>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Is there an actual call to a
“something.set_Output(…)” method somewhere in the code? </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">If so it should be
“something.Output = ….” – in 2.0 we no longer allow calling properties </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">via the property methods.</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; border-width: medium medium medium 1.5pt; padding: 0in 0in 0in 4pt;">
<div>
<div style="border-style: solid none none; border-color: -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">
<p><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> <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 5:56 PM</span></p>
<div>
<div>
<p><span style="font-size: 10pt;"><br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> Re: [IronPython] Compiling IronPythonConsole.exe</span></p>
</div>
</div>
</div>
</div>
<div>
<div>
<p> </p>
<p style="margin-bottom: 12pt;">Well I am about ready to give up for the night
anyway here is my last error :-)<br>
<br>
<br>
>>> import sys<br>
>>> sys.path.append(r"C:\Python25\Lib\site-packages")<br>
>>> import readline<br>
Traceback (most recent call last):<br>
File "<stdin>", line 1, in <module><br>
File "C:\Python25\Lib\site-packages\readline.py", line 4, in
C:\Python25\Lib\s<br>
ite-packages\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 409, in install_readline<br>
AttributeError: 'IronPythonWrapper' object has no attribute 'set_Output'<br>
>>></p>
<div>
<p>On Wed, May 6, 2009 at 5:31 PM, Dino Viehland <<a href="mailto:dinov@microsoft.com" target="_blank">dinov@microsoft.com</a>>
wrote:</p>
<div>
<div>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">The last line should probably
be:</span></p>
<div>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">cmdLine.Run(Python.CreateEngine(),
IronPythonWrapper(), PythonConsoleOptions())</span></p>
</div>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">I thought IronPythonWrapper was
an instance but it looks like it’s a type – so it needs to be constructed.</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; border-width: medium medium medium 1.5pt; padding: 0in 0in 0in 4pt;">
<div>
<div style="border-style: solid none none; border-color: -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">
<p><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> <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 5:24 PM</span></p>
<div>
<div>
<p><span style="font-size: 10pt;"><br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> Re: [IronPython] Compiling IronPythonConsole.exe</span></p>
</div>
</div>
</div>
</div>
<div>
<div>
<p> </p>
<p style="margin-bottom: 12pt;">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>
</p>
<div>
<p>On Wed, May 6, 2009 at 2:48 PM, Dino Viehland <<a href="mailto:dinov@microsoft.com" target="_blank">dinov@microsoft.com</a>>
wrote:</p>
<div>
<div>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">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></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">import clr</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">clr.AddReference(‘IronPython’)</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">clr.AddReference(‘Microsoft.Scripting’)</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">from IronPython.Hosting import
PythonCommandLine, PythonConsoleOptions, Python</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">cmdLine = PythonCommandLine()</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">cmdLine.Run(Python.CreateEngine(),
IronPythonWrapper, PythonConsoleOptions())</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">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></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">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: 11pt; font-family: Wingdings; color: rgb(31, 73, 125);">J</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; border-width: medium medium medium 1.5pt; padding: 0in 0in 0in 4pt;">
<div>
<div style="border-style: solid none none; border-color: -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">
<p><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> <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</span></p>
<div>
<p><span style="font-size: 10pt;"><br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> Re: [IronPython] Compiling IronPythonConsole.exe</span></p>
</div>
</div>
</div>
<p> </p>
<p style="margin-bottom: 12pt;">Hello</p>
<div>
<div>
<p style="margin-bottom: 12pt;"><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</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:</p>
<p>Andrew Evans skrev:</p>
<div>
<blockquote style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(204, 204, 204); border-width: medium medium medium 1pt; margin: 5pt 0in 5pt 4.8pt; padding: 0in 0in 0in 6pt;">
<p> </p>
<p style="margin-bottom: 12pt;">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 :-)</p>
</blockquote>
<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: rgb(136, 136, 136);"><br>
<br>
/Jörgen</span></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></p>
</div>
</div>
</div>
<p> </p>
</div>
</div>
</div>
</div>
</div>
<p style="margin-bottom: 12pt;"><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></p>
</div>
<p> </p>
</div>
</div>
</div>
</div>
</div>
<p style="margin-bottom: 12pt;"><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></p>
</div>
<p> </p>
</div>
</div>
</div>
</div>
</div>
<p style="margin-bottom: 12pt;"><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></p>
</div>
<p> </p>
</div></div></div>
</div>
</div>
<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><br>
<br></blockquote></div><br>