[IronPython] Fails to import IronPythonConsole
Curt Hagenlocher
curt at hagenlocher.org
Sun Mar 22 09:50:53 PDT 2009
Interesting. I didn't realize that pyreadline had specific IronPython
support.
In 2.0, the way to hook input and output is through the DLR hosting
interfaces -- through ScriptRuntime.IO. There may be quite a few changes
required to adapt this. Have you asked the pyreadline maintainers if they
have a 2.0-compatible version?
2009/3/22 Akki Reddy <akkireddy.gunta at gmail.com>
> Hi Curt,
>
> Thanks for a prompt response.
>
>
> The usage in python\pyreadline\pyreadline\console\ironpython_console.py is
> as follows:
>
> import clr,sys
> clr.AddReferenceToFileAndPath(sys.executable)
> import IronPythonConsole
>
> ...
> ...
> ...
>
> class IronPythonWrapper(IronPythonConsole.IConsole):
> def ReadLine(self,autoIndentSize):
> return hook_wrap()
> def Write(self,text, style):
> System.Console.Write(text)
> def WriteLine(self,text, style):
> System.Console.WriteLine(text)
> IronPythonConsole.PythonCommandLine.MyConsole = IronPythonWrapper()
>
>
> This is from a third party python package. Can I replace it with any
> available console functionality from the latest IronPython?
>
>
> Thanks,
> Akki.
>
> 2009/3/22 Curt Hagenlocher <curt at hagenlocher.org>
>
> You can import "clr" under CPython? Neat! :P
>>
>> I don't believe there's a namespace called IronPythonConsole in IronPython
>> 2. What specifically are you trying to use from that namespace?
>>
>> 2009/3/22 Akki Reddy <akkireddy.gunta at gmail.com>
>>
>>> Hi,
>>> I have installed IronPython 2.0.1. We have a project running under
>>> CPython, but fails to run under IronPython.
>>> It is fails import the module IronPythonConsole.
>>>
>>> The script contains the following lines:
>>>
>>> import clr,sys
>>> clr.AddReferenceToFileAndPath(sys.executable)
>>> import IronPythonConsole
>>>
>>> The script fails with the following error when running under IronPython:
>>> ImportError: No module named IronPythonConsole
>>>
>>>
>>> Does anybody know how to resolve this issue?
>>>
>>> Thanks in advance,
>>> Akki.
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.ironpython.com
>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>>
>>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20090322/bbc4fe4b/attachment-0001.htm>
More information about the Users
mailing list