[IPython-user] pysh variable substituion and scope

Krishna Mohan Gundu gkmohan at gmail.com
Tue Jun 13 18:55:47 CDT 2006


Hi Ville,

This is up for discussion.

First of all, I am surprised to know that shell allows splitting
literals across a line (never tried it before), which is illegal in
python.
let a=1
let a=a+1\
2
echo $a
13

I effectively treated the newline escape as a space, when joining
lines. Keeping the newline escape does not solve the problem as a raw
string is passed to _ip.system(). For example  _ip.system("ls
/home/\\\nkrishna") would work but not _ip.system(r"ls
/home/\\\nkrishna"). As you are well aware we need to pass raw input
to correctly handle, among other things,
_ip.system("c:\home\krishna").

Currently I can't think of any solution, except resorting to not using
such esoteric commands.

cheers,
Krishna.

On 6/12/06, Ville Vainio <vivainio at gmail.com> wrote:
> On 6/8/06, Krishna Mohan Gundu <gkmohan at gmail.com> wrote:
>
> > Here is the patch. It works for the previous example I sent. I am
> > confident that the patch is robust (but who knows!?) for variable
> > substitution as I tried to handle all exceptions. The patch also
> > includes new runlines routine which handles multiline commands. But
> > like I said before please check if the line numbering is handled
> > properly and ofcourse if any checks are required on buffer size.
>
> The patch is now committed; however, line splitting with \ doesn't work:
>
> [home]|22> !cd C:/Temp\
> The system cannot find the path specified.
>
> --
> Ville Vainio - vivainio.googlepages.com
> vainio.blogspot.com - g[mail | talk]='vivainio'
>




More information about the IPython-user mailing list