Did I find the right examples for you? yes no

All Samples(9868)  |  Call(9868)  |  Derive(0)  |  Import(0)
Write a string to the file.

There is no return value.

src/d/j/django-navbar-0.3.0/examples/dbgp/client.py   django-navbar(Download)
            # always write to the end
            StringIO.StringIO.seek(self, 0, 2)
            StringIO.StringIO.write(self, s)
            self._read_cv.notify()
        finally:

src/b/i/bitey-0.0/examples/mandel/png.py   bitey(Download)
            return _main(['testPGMin'])
        s = StringIO()
        s.write('P5 2 2 3\n')
        s.write('\x00\x01\x02\x03')
        s.flush()
            return _main(['testPAMin'])
        s = StringIO()
        s.write('P7\nWIDTH 3\nHEIGHT 1\nDEPTH 4\nMAXVAL 255\n'
                'TUPLTYPE RGB_ALPHA\nENDHDR\n')
        # The pixels in flat row flat pixel format
        flat =  [255,0,0,255, 0,255,0,120, 0,0,255,30]
        s.write(''.join(map(chr, flat)))
            return _main(['testPNMsbit'])
        s = StringIO()
        s.write('P6 8 1 1\n')
        for pixel in range(8):
            s.write(struct.pack('<I', (0x4081*pixel)&0x10101)[:3])

src/b/i/bitey-HEAD/examples/mandel/png.py   bitey(Download)
            return _main(['testPGMin'])
        s = StringIO()
        s.write('P5 2 2 3\n')
        s.write('\x00\x01\x02\x03')
        s.flush()
            return _main(['testPAMin'])
        s = StringIO()
        s.write('P7\nWIDTH 3\nHEIGHT 1\nDEPTH 4\nMAXVAL 255\n'
                'TUPLTYPE RGB_ALPHA\nENDHDR\n')
        # The pixels in flat row flat pixel format
        flat =  [255,0,0,255, 0,255,0,120, 0,0,255,30]
        s.write(''.join(map(chr, flat)))
            return _main(['testPNMsbit'])
        s = StringIO()
        s.write('P6 8 1 1\n')
        for pixel in range(8):
            s.write(struct.pack('<I', (0x4081*pixel)&0x10101)[:3])

src/a/s/astral-HEAD/examples/webcam_and_rtmp/amf.py   astral(Download)
    def write_utf8(self, c): self.write(c.encode('utf8'))
 
    def read_u29(self):
        n = result = 0; b = self.read_u8()
        while b & 0x80 and n < 3: result <<= 7; result |= b & 0x7f; b = self.read_u8(); n += 1
        if c >= 0x200000: bytes += chr(c & 0xff)
        else: bytes += chr(c & 0x7f)
        self.write(bytes)
    def write_s29(self, c):
        if c < -0x10000000 or c > 0x0fffffff: raise ValueError('sint29 out of range')

src/n/e/neutron-drive-HEAD/google_appengine/lib/PyAMF/doc/tutorials/examples/gateways/appengine/demo/shell/gateway.py   neutron-drive(Download)
  def evalCode(self, request, statement):
    statement = statement.strip().replace('\r\n', '\n').replace('\r', '\n')
    buffer = StringIO.StringIO()
 
    buffer.write(statement + '\n')
        session.put()
    except:
      buffer.write(traceback.format_exc())
 
    buffer.write('>>> ')

src/m/o/motionless-HEAD/examples/gpolyencode.py   motionless(Download)
 
        if (self._force_endpoints):
            encoded_levels.write(self._encode_number(self._num_levels - 1))
        else:
            encoded_levels.write(self._encode_number(self._num_levels - self._compute_level(abs_max_dist) - 1))
 
        n_points = len(points)
        for i,p in enumerate(points):
            if (i > 0) and (i < n_points-1) and (i in dists):
                encoded_levels.write(self._encode_number(self._num_levels - self._compute_level(dists[i]) -1))
                plat = late5
                plng = lnge5
                encoded_points.write(self._encode_signed_number(dlat))
                encoded_points.write(self._encode_signed_number(dlng))
 

src/m/2/M2Crypto-HEAD/examples/ssl/https_srv.py   M2Crypto(Download)
def mkdirlist(path, url):
    dirlist = os.listdir(path)
    dirlist.sort()
    f = StringIO()
    f.write('<title>Index listing for %s</title>\r\n' % (url,))
    f.write('<h1>Index listing for %s</h1>\r\n' % (url,))
    f.write('<pre>\r\n')
            d2 = d
        if url == '/':
            f.write('<a href="/%s">%s</a><br>\r\n' % (d, d2))
        else:
            f.write('<a href="%s/%s">%s</a><br>\r\n' % (url, d, d2))

src/m/2/M2Crypto-HEAD/examples/https.howto/orig_https_srv.py   M2Crypto(Download)
def mkdirlist(path, url):
    dirlist = os.listdir(path)
    dirlist.sort()
    f = StringIO()
    f.write('<title>Index listing for %s</title>\r\n' % (url,))
    f.write('<h1>Index listing for %s</h1>\r\n' % (url,))
    f.write('<pre>\r\n')
            d2 = d
        if url == '/':
            f.write('<a href="/%s">%s</a><br>\r\n' % (d, d2))
        else:
            f.write('<a href="%s/%s">%s</a><br>\r\n' % (url, d, d2))

src/t/r/tropofy-0.41.4/tropofy_example_apps/additional_dependencies/gurobi/sudoku/sudoku.py   tropofy(Download)
    for r in Rows:
        if r == "1" or r == "4" or r == "7":
            sudokuout.write("+-------+-------+-------+<br>")
        row_sol = []
        for c in Cols:
            for v in Vals:
                if value(choices[v][r][c]) == 1:
                    if c == "1" or c == "4" or c == "7":
                        sudokuout.write("| ")
                    sudokuout.write(v + " ")
                    row_sol.append(v)
                    if c == "9":
                        sudokuout.write("|<br>")
        data_set.add(SudokuAnswerRow(row_sol[0], row_sol[1], row_sol[2], row_sol[3], row_sol[4], row_sol[5], row_sol[6], row_sol[7], row_sol[8]))
    sudokuout.write("+-------+-------+-------+")

src/p/y/PyMOTW-2.0.1/PyMOTW/StringIO/stringio_examples.py   PyMOTW(Download)
# Writing to a buffer
output = StringIO()
output.write('This goes into the buffer. ')
print >>output, 'And so does this.'
 

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