[IPython-user] Control chars showing up when running ipython from inside emacs

unussum@gmai... unussum@gmai...
Sat Dec 13 22:33:24 CST 2008


I found that everything except the verbose file output (which I can  
live with) was taken care of by adding

(setq py-python-command-args '("-colors" "NoColor"))

to my .emacs file.

My remaining irritation is that tab completion doesn't seem to be  
working quite right in the interactive shell.

See example where I set myvar and then type myv and hit tab:

In [19]: myvar = "asdf"
myvar = "asdf"

In [20]: int ';'.join(__IP.Completer.all_completions('myv')) #PYTHON- 
MODE SILENT
myvar

In [21]: myv


Also, it does not actually complete the variable if there's only one  
completion.


On Dec 13, 2008, at 7:10 PM, unussum@gmail.com wrote:

> I'm running IPython 0.9.1 inside GNU Emacs 22.1.1 on Mac OS X 10.5.5  
> with the files downloaded from:
>
> http://ipython.scipy.org/tmp/python-mode.el
> http://ipython.scipy.org/dist/ipython.el
>
> and the following added to my ~/.emacs file:
>
> ;; For IPython
> (add-to-list 'load-path "~/Code/Emacs")
> (setq ipython-command "/usr/local/bin/ipython")
> (require 'ipython)
>
> When I open emacs and type "M-x py-shell" to open an IPython shell  
> everything shows up properly but the prompt shows up with a bunch of  
> control characters visible, e.g.:
>
> Leopard libedit detected.
> /Users/Larry/.ipython/ipy_user_conf.py:117: DeprecationWarning: Call  
> to depreca\
> ted function ipmagic, use _ip.magic() instead
>  ipmagic("cd ~/Code/Scripts/Python")
> /Users/Larry/Code/Scripts/Python
> Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 0.9.1 -- An enhanced Interactive Python.
> ?         -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help      -> Python's own help system.
> object?   -> Details about 'object'. ?object also works, ?? prints  
> more.
>
> ^A^BIn [^A^B1^A^B]: ^A^B
>
>
> The prompt itself seems to show up properly colored in blue. If I  
> create a test.py file with the simple line 'print "Hi"' and hit C-c  
> C-c to run it, things are also not as might be desired—I get the  
> following output:
>
>
> Leopard libedit detected.
> /Users/Larry/.ipython/ipy_user_conf.py:117: DeprecationWarning: Call  
> to depreca\
> ted function ipmagic, use _ip.magic() instead
>  ipmagic("cd ~/Code/Scripts/Python")
> /Users/Larry/Code/Scripts/Python
> Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 0.9.1 -- An enhanced Interactive Python.
> ?         -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help      -> Python's own help system.
> object?   -> Details about 'object'. ?object also works, ?? prints  
> more.
>
> ^A^BIn [^A^B1^A^B]: ^A^B## working on region in file /var/folders/ID/ 
> IDoqvBG+H4\
> Wg0BEeikwZzU+++TI/-Tmp-/python-529h3F.py...
> execfile(r'/var/folders/ID/IDoqvBG+H4Wg0BEeikwZzU+++TI/-Tmp-/ 
> python-529h3F.py')\
> # PYTHON-MODE
> Hi
>
> ^A^BIn [^A^B2^A^B]: ^A^B
>
>
> With a bunch of extra info I'd rather not have (the desire would be  
> a simple "Hi" as the output without all the file info).
>
> Does anybody have any suggestions as to how these issues might be  
> alleviated? I'm still very much newly come to configuring Emacs, so  
> if I'm missing something obvious please enlighten me!



More information about the IPython-user mailing list