Re: passing stdin to a script
Thomas Kluyver <[email protected]> Thu, 10 Mar 2016 20:54:54 +0000
| Newsgroups | gmane.comp.python.ipython.user |
|---|---|
| Message-ID | <CAOvn4qh3fgtMXC_Hdt5dGKZ=R3KB4pdvbmF3q4ZTPii=wFsGyw@mail.gmail.com> |
--===============1085502025189347290== Content-Type: multipart/alternative; boundary=001a1140ed5a857f2e052db808e2 --001a1140ed5a857f2e052db808e2 Content-Type: text/plain; charset=UTF-8 On 9 March 2016 at 23:24, Ruslan Dautkhanov <[email protected]> wrote: > Can't find in documentation how to pass stdin to a > %%script perl > perl code .. > IIRC, the code in the cell is passed to perl (or the selected interpreter) on stdin. If it reads line-by-line, you could presumably put the input you want just after the line that tries to read from stdin. If it reads the whole lot and then tries to run it, you're out of luck. Thomas --001a1140ed5a857f2e052db808e2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On 9= March 2016 at 23:24, Ruslan Dautkhanov <span dir=3D"ltr"><<a href=3D"ma= ilto:[email protected]" target=3D"_blank">[email protected]</a>></= span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e= x;border-left:1px #ccc solid;padding-left:1ex"><div>Can't find in docum= entation how to pass stdin to a=C2=A0</div><div>=C2=A0%%script perl=C2=A0<b= r></div><div>=C2=A0perl code ..=C2=A0</div></blockquote></div><br></div><di= v class=3D"gmail_extra">IIRC, the code in the cell is passed to perl (or th= e selected interpreter) on stdin. If it reads line-by-line, you could presu= mably put the input you want just after the line that tries to read from st= din. If it reads the whole lot and then tries to run it, you're out of = luck.<br><br></div><div class=3D"gmail_extra">Thomas<br></div></div> --001a1140ed5a857f2e052db808e2-- --===============1085502025189347290== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ IPython-User mailing list [email protected] https://mail.scipy.org/mailman/listinfo/ipython-user --===============1085502025189347290==--