Jörgen Stenarson | 1 Nov 20:06
Picon

Re: Chinese char width problem in pyreadline

pan skrev:
> First time I haved tried to use 'decode(consolecodepage, "replace") '. 
> But it seems python parser will convert all the source code to utf8, and 
> also returns the parsered identifier as utf8. If you use non-ascii 
> characters as identifier, the returned identifier will be converted to 
> utf8, not the encoding as your input. But the current python does not 
> support non-ascii characters as identifier, so I use 
> decode("utf8","replace") just for displaying the encoding text of error 
> trackback about the non-ascii characters identifier correctly.
> 

I don't quite understand what you are trying to say. Lets try an 
example. The attached png shows what happens when I try to print a 
string containing swedish characters for the two cases using 
consolecodepage and utf8. As you can see using utf8 results in garbage 
being printed. What do things look like for you?

Another problem occurs when using ipython and doing completions on 
filenames containing non-ascii names. The best fix would probably be to 
patch the completer to generate unicode strings of filenames. I don't 
think we can solve this in a general way with fixes in pyreadline since 
the file system may have another encoding than the console. If you have 
any ideas here I'd love to hear them.

Thanks for working on this. I hope we can find a solution that works 
well with these wide character sets. I don't use them myself but I know 
how annoying it can be to not be able to use your full alphabet.

/Jörgen
(Continue reading)

Brian Granger | 1 Nov 21:23
Picon

IPython under Leopard

Hi,

I just committed Boyd Water's patches to get IPython working under
Leopard.  The Python 2.5.1 that comes with Leopard includes readline
support through the libedit library.  Libedit has a slightly different
config syntax, and IPython now takes this into account.

This means that the current svn of IPython will work work (with tab
completion) of Leopard out of the box.  Thanks to Boyd for this patch!

Enjoy and please let us know if you encounter other problems with
IPython on Leopard.

Brian
Ville M. Vainio | 8 Nov 22:10
Picon
Gravatar

Implemented in svn: apt-get completer

If you use sh profile (or do 'import ipy_app_completers'), you can
take advantage of the apt-get completer:

[~/ipython]|5> apt-get <tab>
autoclean        clean            install          source
build-dep        dist-upgrade     purge            update
check            dselect-upgrade  remove           upgrade
[~/ipython]|5> apt-get install kat<tab>
kat           katapult      kate-plugins  katoob
katalog       kate          kat

--

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'
Jörgen Stenarson | 9 Nov 21:53
Picon

pyreadline unicode updates

Hi,

I have done some more fixes to get the unicode patch to pyreadline to 
work. The latest fixes were made to get filename completion to work in 
ipython when filenames contain non-ascii characters.

Since the completer function returns str characters to pyreadline we 
need to assume an encoding on these characters. Currently I assume the 
encoding to be the same as for all other conversion i.e. 
sys.stdout.encoding by default. This can be overridden by setting:
pyreadline.unicode_helper.pyreadline_codepage to the desired codepage.

Please try it out and report any problems.

/Jörgen
Jörgen Stenarson | 10 Nov 19:47
Picon

Re: Chinese char width problem in pyreadline

I have made some changes since the version I think you are using. Can
you update and try again?

I use two functions to go from unicode->str and str->unicode to get a 
uniform treatment everywhere. We may have to change this at some point
but I think it is a good starting point to have a uniform treatment.

These functions are in pyreadline.unicode_helper
ensure_unicode converts str->unicode assuming pyreadline_encoding
ensure_str     converts unicode->str assuming pyreadline_encoding
pyreadline_encoding  contains the current encoding by default 
sys.stdout.encoding

/Jörgen

pan skrev:
> Sorry for the delayed reply. The attached png shows some encoding 
> problems(but the problems may be not due to pyreadline):
> 1. 0.png shows the varying encodings(utf8, cp936, unicode) of the same 
> Chinese characters.
> 2. 1.png shows the problems occurs when using python console with pyreadline
> 3. 2.png shows the problems occurs when using ipython console with 
> pyreadline
> 
> The reason(I thought) of "using utf8 results in garbage being printed" 
> is that:
> 1. readline_hook returns to the paser of python with the string of 
> consolecodepage(utf8) encoding: 
> readline_hook(prompt).encode(consolecodepage).
> 2. but the parser of python thinks the text is encoded as cp1252(maybe 
(Continue reading)

wang frank | 17 Nov 23:50
Picon

how to use ipython in xemacs on winxp

Hi,
 
I am struggling to make the ipython works with xemacs on winxp. I have been searching in the internet and follwoing these instrucitons but still it does not work.
 
My ipython version is 0.8.1 and python-mode is 4.76. Xemacs is version 22.1. When I type M-x load library ipython, emacs responses it is done. then I type M-x py-shell, xemacs opens a python window. but without start the ipython. So I coulde not do anything. If I quit the xemacs, it will say an active process is still running do you want to kill?
 
Does anyone have successuffly use ipython in xemacs? If so could you share your procedure with me?
 
Thanks
 
Frank

10月のキーワード月間ランキング1位は「初音ミク」、2位は家族ぐるみの・・・ http://keyword.jp.msn.com/default.aspx
_______________________________________________
IPython-user mailing list
IPython-user <at> scipy.org
http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
Pete Forman | 19 Nov 12:26

Re: how to use ipython in xemacs on winxp

wang frank <fw3 <at> hotmail.co.jp> writes:

 > I am struggling to make the ipython works with xemacs on winxp. I
 > have been searching in the internet and follwoing these
 > instrucitons but still it does not work.
 >
 > My ipython version is 0.8.1 and python-mode is 4.76. Xemacs is
 > version 22.1. When I type M-x load library ipython, emacs responses
 > it is done. then I type M-x py-shell, xemacs opens a python
 > window. but without start the ipython. So I coulde not do
 > anything. If I quit the xemacs, it will say an active process is
 > still running do you want to kill?
 >
 > Does anyone have successuffly use ipython in xemacs? If so could
 > you share your procedure with me?

In ~/.xemacs/init.el:

(setq ipython-command "d:/Program Files/Python25/Scripts/ipython.bat")
(require `ipython)

In ~/.xemacs/custom.el, i.e. set with customize:

(py-python-command-args '("-pylab" "-colors" "LightBG"))

Then I start it with M-x py-shell, or its binding C-c ! in a python
file's buffer.

python-mode 4.79
ipython 1851 (0.7.3 I think)
XEmacs 21.5.17
Windows XP SP2
Python 2.5.1
--
Pete Forman                -./\.-  Disclaimer: This post is originated
WesternGeco                  -./\.-   by myself and does not represent
pete.forman <at> westerngeco.com    -./\.-   the opinion of Schlumberger or
http://petef.port5.com           -./\.-   WesternGeco.
wang frank | 19 Nov 22:03
Picon

Re: how to use ipython in xemacs on winxp

Hi, Pete,
 
Thanks for the help.
 
I have done all procedures of what you said. However, after I type M-x py-shell, I did not get the command prompt. If I type ls in the frame, I will see the list of file and also the In[] and Out[] prompt from ipython.
 
the ipython.bat contains: c:\python25\python c:\python25\scripts\ipython.py
 
Where did you get the python-mode.el version 4.79? I can only find the verion 4.75.
 
Here is the python shell out put after I typy ls.
 
In [10]:
In [11]:
In [11]:  Volume in drive C has no label.
 Volume Serial Number is 6406-BBE2
 Directory of c:\Documents and Settings\ywang44
2007-11-18  21:32    <DIR>          .
2007-11-18  21:32    <DIR>          ..
2006-01-04  21:13                 5 .bash_history
2006-06-28  16:07    <DIR>          .p4qt
2006-07-10  14:51    <DIR>          .p4scc
2006-10-03  09:42            16,329 _viminfo
2007-10-12  16:20             4 ,433 1
2007-11-16  22:05    <DIR>          Desktop
2007-11-17  23:04    <DIR> &nbs p;        Favorites
2007-11-13  17:24    <DIR>          My Documents
2007-10-04  08:24    <DIR>          Phone Browser
2006-12-27  09:57             2,440 ProSet2XML.log
2006-04-19  19:36               600 PUTTY.RND
2007-09-06  12:25    <DIR>          Scilab
2007-01-08  15:04    <DIR>          Start Menu
2005-12-16&nb sp; 20:52    <DIR>          VSWebCache
2005-09-15  08:14    <DIR>           WINDOWS
2007-10-12  08:28    <DIR>          workspace
               5 File(s)         23,807 bytes
              13 Dir(s)   8,505,108,992 bytes free
c:\python25\scripts\ipy.bat -i -colors LightBG
 
You can see after the last line, there are no commad prompt.
 
How could I solve this problem?
 
Thanks
 
Frank

> To: ipython-user <at> scipy.net
> From: pete.forman <at> westerngeco.com
> Date: Mon, 19 Nov 2007 11:26:31 +0000
> Subject: Re: [IPython-user] how to use ipython in xemacs on winxp
>
> wang frank <fw3 <at> hotmail.co.jp> writes:
>
> > I am struggling to make the ipython works with xemacs on winxp. I
> > have been searching in the internet and follwoing these
> > instrucitons but still it does not work.
> >
> > My ipython version is 0.8.1 and python-mode is 4.76. Xemacs is
> > version 22.1. When I type M-x load library ipython, emacs responses
> > it is done. then I type M-x py-shell, xemacs opens a python
> > window. but without start the ipython. So I coulde not do
&gt ; > anything. If I quit the xemacs, it will say an active process is
> > still running do you want to kill?
> >
> > Does anyone have successuffly use ipython in xemacs? If so could
> > you share your procedure with me?
>
> In ~/.xemacs/init.el:
>
> (setq ipython-command "d:/Program Files/Python25/Scripts/ipython.bat")
> (require `ipython)
>
> In ~/.xemacs/custom.el, i.e. set with customize:
>
> (py-python-command-args '("-pylab" "-colors" "LightBG"))
>
> Then I start it with M-x py-shell, or its binding C-c ! in a python
> file's buffer.
>
> python-mode 4.79
> ipython 1851 (0.7.3 I think)
> XEmacs 21.5.17
> Windows XP SP2
> Python 2.5.1
> --
> Pete Forman -./\.- Disclaimer: This post is originated
> WesternGeco -./\.- by myself and does not represent
> pete.forman <at> westerngeco.com -./\.- the opinion of Schlumberger or
> http://petef.port5.com -./\.- WesternGeco.
>
> _______________________________________________
> IPython-user mailing list
> IPython-user <at> sc ipy.org
> http://lists.ipython.scipy.org/mailman/listinfo/ipython-user


ほら、変わったでしょ? マイクロソフトといっしょに、次のデジタルライフへ http://go.windowslive.jp/
_______________________________________________
IPython-user mailing list
IPython-user <at> scipy.org
http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
Pete Forman | 20 Nov 10:20

Re: how to use ipython in xemacs on winxp

wang frank <fw3 <at> hotmail.co.jp> writes:

 > Where did you get the python-mode.el version 4.79? I can only find the verion
 > 4.75.

It is in Subversion on SourceForge.  The version naming has changed.
Revision 425 is identical to 4.79, except for the "4.79" string.
There is a later version 426 which supports the "with" keyword.

http://python-mode.svn.sourceforge.net/viewvc/python-mode/trunk/python-mode/python-mode.el?view=log

There was a thread on IPython + XEmacs + Windows starting in
2006-12-29.  I started it with a typo "now working" when I meant "not
working".  By the end of the thread the title was correct. :-)

http://lists.ipython.scipy.org/pipermail/ipython-user/2006-December/thread.html#3952
http://lists.ipython.scipy.org/pipermail/ipython-user/2007-January/thread.html#3994
http://lists.ipython.scipy.org/pipermail/ipython-user/2007-February/thread.html#4040
http://lists.ipython.scipy.org/pipermail/ipython-user/2007-March/thread.html#4147
--

-- 
Pete Forman                -./\.-  Disclaimer: This post is originated
WesternGeco                  -./\.-   by myself and does not represent
pete.forman <at> westerngeco.com    -./\.-   the opinion of Schlumberger or
http://petef.port5.com           -./\.-   WesternGeco.
Jörgen Stenarson | 20 Nov 20:08
Picon

Re: Chinese char width problem in pyreadline

pan skrev:

> And the attached patch fixed cursor flicking and some Asian IME problem.
I have applied this patch. Thanks for helping out to make 
pyreadline/ipython more usable in an asian context. These are issues 
that are very difficult to work on when you can't test it.

/Jörgen

Gmane