[IPython-User] Pipe into file

Max Bane max.bane@gmail....
Thu Jul 15 10:45:07 CDT 2010


The standard Python print statement supports something like this (not sure
about Python 3.0, though).

In [1]: f = open('test.txt', 'w')

In [2]: print >> f, 'hello, world'

In [3]: f.close()

In [4]: !cat test.txt
hello, world


On Thu, Jul 15, 2010 at 6:00 AM, Richard Parsons <
richard.lee.parsons@gmail.com> wrote:

> How do I pipe the output into a file?
>
> I want to do this, but it doesn't work...
>
> print variable > some_filename
>
> Thanks,
> Richard
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>



-- 
Max Bane
PhD Student, Linguistics
University of Chicago
bane@uchicago.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20100715/41191620/attachment.html 


More information about the IPython-User mailing list