Did I find the right examples for you? yes no

All Samples(57119)  |  Call(41846)  |  Derive(656)  |  Import(14617)
class StringIO([buffer])

When a StringIO object is created, it can be initialized to an existing
string by passing the string to the constructor. If no string is given,
the StringIO will start empty.

The StringIO object can accept either Unicode or 8-bit strings, but
mixing the two may take some care. If both are used, 8-bit strings that
cannot be interpreted as 7-bit ASCII (that use the 8th bit) will cause
a UnicodeError to be raised when getvalue() is called.

src/e/p/eppy-HEAD/eppy/tests/test_examples.py   eppy(Download)
idfsnippet = snippet.idfsnippet
 
from StringIO import StringIO
idffhandle = StringIO(idfsnippet)
iddfhandle = StringIO(iddsnippet)

src/p/y/pygpgme-0.3/examples/encrypt.py   pygpgme(Download)
import gpgme
try:
    from io import BytesIO
except ImportError:
    from StringIO import StringIO as BytesIO
key = ctx.get_key('B10A449E4CFB9A60A2DB996701AF93D991CFA34D')
 
plain = BytesIO(b'Hello World\n')
cipher = BytesIO()
 

src/b/a/baepython_sdk-HEAD/examples/weibotest/0/web/browser.py   baepython_sdk(Download)
import httplib, urllib, urllib2
import copy
from StringIO import StringIO
 
DEBUG = False
    def get_response(self):
        """Returns a copy of the current response."""
        return urllib.addinfourl(StringIO(self.data), self._response.info(), self._response.geturl())
 
    def get_soup(self):
    def _make_response(self, result, url):
        data = "\r\n".join(["%s: %s" % (k, v) for k, v in result.header_items])
        headers = httplib.HTTPMessage(StringIO(data))
        response = urllib.addinfourl(StringIO(result.data), headers, url)
        code, msg = result.status.split(None, 1)

src/s/t/statsmodels-0.5.0/statsmodels/examples/try_tukey_hsd.py   statsmodels(Download)
    'USA', 'USA', 'USA', 'Japan', 'USA', 'USA', 'USA', 'Germany', 'USA', 'USA', 'USA'])
 
dta = np.recfromtxt(StringIO.StringIO(ss), names=("Rust","Brand","Replication"))
dta2 = np.recfromtxt(StringIO.StringIO(ss2), names = ("idx", "Treatment", "StressReduction"))
dta3 = np.recfromtxt(StringIO.StringIO(ss3), names = ("Brand", "Relief"))
1 - 3	-0.260	-3.909	3.389	'''
 
dta5 = np.recfromtxt(StringIO.StringIO(ss5), names = ('pair', 'mean', 'lower', 'upper', 'sig'), delimiter='\t')
 
sas_ = dta5[[1,3,2]]

src/p/y/PyMOTW-2.0.1/PyMOTW/StringIO/stringio_examples.py   PyMOTW(Download)
    from cStringIO import StringIO
except:
    from StringIO import StringIO
 
# Writing to a buffer
output = StringIO()
 
# Initialize a read buffer
input = StringIO('Inital value for read buffer')
 
# Read from the buffer

src/l/i/libcloud-HEAD/docs/examples/storage/publish_static_website_on_cf.py   libcloud(Download)
from StringIO import StringIO
 
from libcloud.storage.types import Provider
from libcloud.storage.providers import get_driver
 
container = driver.create_container(container_name='my_website')
 
iterator1 = StringIO('<p>Hello World from Libcloud!</p>')
iterator2 = StringIO('<p>Oh, noez, 404!!</p>')
iterator3 = StringIO('<p>Oh, noez, 401!!</p>')

src/m/u/Muntjac-1.1.2/muntjac/demo/sampler/features/dragndrop/DragDropHtml5FromDesktopExample.py   Muntjac(Download)
 
try:
    from cStringIO import StringIO
except ImportError, e:
    from StringIO import StringIO
                            Notification.TYPE_WARNING_MESSAGE)
                else:
                    bas = StringIO()
 
                    sv = FileStreamVariable(self, fileName, html5File, bas)
    def getStream(self):
        if self._bas is not None:
            byteArray = self._bas.getvalue()
            return StringIO(byteArray)
        return None
    def __setstate__(self, d):
        self.__dict__ = d
        bas_str = d.get('_bas_str', '')
        self._bas = StringIO(bas_str)
 

src/d/j/django-admin-report-HEAD/example/lib/reportlab/lib/utils.py   django-admin-report(Download)
    from cStringIO import StringIO as __StringIO
except ImportError:
    from StringIO import StringIO as __StringIO
def getStringIO(buf=None):
    '''unified StringIO instance interface'''
    return buf is not None and __StringIO(buf) or __StringIO()

src/s/t/Starcraft-Tracker-Server-HEAD/exampletests.py   Starcraft-Tracker-Server(Download)
 
import base64
from StringIO import StringIO
 
from models import *
    def testGetRssFeeds(self):
        response = self.client.get('/api/rss/', {}, **self.extra)
        self.assertEqual(response.status_code, 200)
 
        result = simplejson.load(StringIO(response.content))
    def testGetRssFeedById(self):
        response = self.client.get('/api/rss/1/', {}, **self.extra)
        self.assertEqual(response.status_code, 200)
 
        result = simplejson.load(StringIO(response.content))
    def testGetRssFeedAfterId(self):
        response = self.client.get('/api/rss/after/1/', {}, **self.extra)
        self.assertEqual(response.status_code, 200)
 
        result = simplejson.load(StringIO(response.content))

src/m/u/muntjac-HEAD/muntjac/demo/sampler/features/dragndrop/DragDropHtml5FromDesktopExample.py   muntjac(Download)
 
try:
    from cStringIO import StringIO
except ImportError, e:
    from StringIO import StringIO
                            Notification.TYPE_WARNING_MESSAGE)
                else:
                    bas = StringIO()
 
                    sv = FileStreamVariable(self, fileName, html5File, bas)
    def getStream(self):
        if self._bas is not None:
            byteArray = self._bas.getvalue()
            return StringIO(byteArray)
        return None
    def __setstate__(self, d):
        self.__dict__ = d
        bas_str = d.get('_bas_str', '')
        self._bas = StringIO(bas_str)
 

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next