[IPython-user] Inconsistency in "!!" ?

Krishna Mohan Gundu gkmohan at gmail.com
Wed Jun 21 15:53:17 CDT 2006


Hello Asheesh,

if you are using pysh profile the following works

for thing in lout('ls'):
  echo $thing

and BTW is documented. You just need to read it.

cheers,
Krishna.

On 6/21/06, Asheesh Laroia <asheesh at asheesh.org> wrote:
> I want to use ipython for as much as possible, so I thought I would try
> writing a shell-style for loop.  First I tested !!ls:
>
>         In [50]: !!ls
>         Out[50]:
>         ['common.py',
>          'domain.py',
>          'histgraph.py',
>          'language.py',
>          'link-counts.py',
>          'link-counts.sh',
>          'postprocess.py',
>          'sumgen.py',
>          'tabgen.py']
>
> That worked just fine.  So can I loop through these?
>
>         In [51]: for thing in !!ls:
>         ------------------------------------------------------------
>            File "<ipython console>", line 1
>              for thing in !!ls:
>                           ^
>         SyntaxError: invalid syntax
>
> That's sad.  Is this expected behavior?  Is there some way I can get this
> to work anyway? (-:
>
> Thanks all!
>
> -- Asheesh.
>
> --
> Never put off till run-time what you can do at compile-time.
>                 -- D. Gries
>
> _______________________________________________
> IPython-user mailing list
> IPython-user at scipy.net
> http://scipy.net/mailman/listinfo/ipython-user
>




More information about the IPython-user mailing list