[IPython-user] Finally, ipython works in emacs

wang frank fw3@hotmail.co...
Thu Dec 20 17:27:29 CST 2007


Thanks for the help.
 
I have added the code into the console.py as
 def write_color(self, text, attr=None):  junk = c_int(0)  self.WriteFile(self.hout, text, len(text), byref(junk),None)  return len(text)  write_plain = write_color
 
I did not put the EMACS environment check since I do not know how. It does not fix the problem. After I added the code and install the pyreadline, the Out[] prompt disappeared. After I quit the ipython, I got the same error:
 
 
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x0133BBB0>
Process Python finished> Date: Thu, 20 Dec 2007 21:41:17 +0100> From: jorgen.stenarson@bostream.nu> To: fw3@hotmail.co.jp> CC: ipython-user@scipy.org> Subject: Re: [IPython-user] Finally, ipython works in emacs> > wang frank skrev:> > I have finally made the ipython works in emacs. The solution is to > > uninstall the pyreadline library. I do not know the reason and hopefully > > the expert can figure it out using my previouse email which includes the > > debug information.> > > > I think this solution has one problem that is when I run the ipython in > > the command shell, without pyreadline it will causes problem. Can I keey > > the pyreadline but do not use it when I am in emacs?> > > > > > There is a commandline flag to turn pyreadline off in ipython. But I > don't know if it turns pyreadline off completely. I believe there is > some import magic that always imports readline if it is available even > if completion and such things are not enabled.> > There used to be some code to deal with emacs in > pyreadline/console/console.py but it seems to have fallen away.> I don't know if it is relevant to your problem. But you could try to add > them in again.> > These lines used to be in around line 377 in pyreadline/console/console.py:> > if os.environ.has_key("EMACS"):> def write_color(self, text, attr=None):> junk = c_int(0)> self.WriteFile(self.hout, text, len(text), byref(junk),None)> return len(text)> write_plain = write_color> > It is activated if you set an environment variable named EMACS> > Now I'm off for christmas and will return in january> > /Jörgen> 
_________________________________________________________________
「MSN クリスマス特集」今年は、最高の愛あふれるクリスマスにしませんか。
http://event.jp.msn.com/xmas2007/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ipython.scipy.org/pipermail/ipython-user/attachments/20071220/0be287cd/attachment-0001.html 


More information about the IPython-user mailing list