attach cString to memoryview?

Peter Otten __peter__ at web.de
Wed Aug 3 15:41:55 CEST 2011


Phlip wrote:

>     q = cStringIO.StringIO()
>     p = Popen(cmd, shell=True, stdout=q, bufsize=4096)

> The Subject line problem refers to how to get rid of this:
> 
>     AttributeError: 'cStringIO.StringO' object
>                                        has no attribute 'fileno'

What's wrong with subprocess.PIPE?

>>> import subprocess as sp                                           
>>> p = sp.Popen(["ls", "/usr/lib/python2.6"], stdout=sp.PIPE)
>>> print p.communicate()[0]




More information about the Python-list mailing list