pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
Wiki

MmapSurfaces

      
Search:  
 
 
# Use mmap to create pygame surfaces in files.
 
import mmap
import os
 
import pygame
 
width, height = 64,64
size = width * height * 3
 
test_file_name = "map_test.txt"
 
if not os.path.exist(test_file_name):
    f = open(test_file_name, "wb")
    f.close()
 
f = open(test_file_name, "r+")
 
 
 
# memory-map the file, size 0 means whole file
amap = mmap.mmap(f.fileno(), size, access=mmap.ACCESS_WRITE )
 
s = pygame.image.frombuffer(amap, (width,height), "RGB")
 
print s.get_at((0,0))
print s.set_at((0,0), (33,33,33,255))
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Oct 16, 2014

Oct 9, 2014

Oct 8, 2014

Oct 7, 2014

Oct 4, 2014

Oct 1, 2014

Sep 19, 2014

Sep 17, 2014

Sep 9, 2014

Sep 8, 2014

Sep 7, 2014


... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)