[IPython-User] passing stdin to a script

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[IPython-User] passing stdin to a script

Ruslan Dautkhanov
Can't find in documentation how to pass stdin to a 
 %%script perl 
 perl code .. 

I have to pass a Python list to a Perl (or a bash) script through stdin.

Was trying to use {} block 
and also tried $variable but it doesn't seems to work.. 


--
Ruslan Dautkhanov

_______________________________________________
IPython-User mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|

Re: passing stdin to a script

Thomas Kluyver-2
On 9 March 2016 at 23:24, Ruslan Dautkhanov <[hidden email]> 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

_______________________________________________
IPython-User mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/ipython-user