Did I find the right examples for you? yes no

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
Writes the string s to the mapfile

        def write_to_memory(mapfile, s):
    """Writes the string s to the mapfile"""
    say("writing %s " % s)
    mapfile.seek(0)
    # I append a trailing NULL in case I'm communicating with a C program.
    s += '\0'
    if PY_MAJOR_VERSION > 2:
        s = s.encode()
    mapfile.write(s)
        


src/p/o/posix_ipc-0.9.8/demo/premise.py   posix_ipc(Download)
# I seed the shared memory with a random string (the current time).
what_i_wrote = time.asctime()
utils.write_to_memory(mapfile, what_i_wrote)
 
for i in range(params["ITERATIONS"]):
        s = s.encode()
    what_i_wrote = hashlib.md5(s).hexdigest()
    utils.write_to_memory(mapfile, what_i_wrote)
 
utils.say("")

src/p/o/posix_ipc-0.9.8/demo/conclusion.py   posix_ipc(Download)
    what_i_wrote = hashlib.md5(s).hexdigest()
 
    utils.write_to_memory(mapfile, what_i_wrote)
 
    if not params["LIVE_DANGEROUSLY"]: