Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #10806

Re: attach cString to memoryview?

From Peter Otten <__peter__@web.de>
Newsgroups comp.lang.python
Subject Re: attach cString to memoryview?
Followup-To comp.lang.python
Date 2011-08-03 15:41 +0200
Organization None
Message-ID <j1bj73$a33$1@solani.org> (permalink)
References <4232b39e-e07c-4e12-92e3-1e7b035422a6@a2g2000prf.googlegroups.com>

Followups directed to: comp.lang.python

Show all headers | View raw


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]

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

attach cString to memoryview? Phlip <phlip2005@gmail.com> - 2011-08-03 06:13 -0700
  Re: attach cString to memoryview? Peter Otten <__peter__@web.de> - 2011-08-03 15:41 +0200

csiph-web