Search code examples
pythonfabric

How to get the content of a remote file without a local temporary file with fabric


I want to get the content of a remote file with fabric, without creating a temporary file.


Solution

  • from StringIO import StringIO
    from fabric.api import get
    
    fd = StringIO()
    get(remote_path, fd)
    content=fd.getvalue()