Skip to content

Instantly share code, notes, and snippets.

View tfmoraes's full-sized avatar

Thiago Franco de Moraes tfmoraes

View GitHub Profile
@tfmoraes
tfmoraes / traceback_memmap.py
Created April 27, 2011 12:14
traceback_memmap
<traceback>
Process Process-1:
Traceback (most recent call last):
File "C:\Python26\Lib\multiprocessing\process.py", line 232, in _bootstrap
self.run()
File "C:\Python26\Lib\multiprocessing\process.py", line 88, in run
self._target(*self._args, **self._kwargs)
File "C:\Documents and Settings\phamorim\Desktop\test.py", line 7, in print_ma
trix
print matrix
@tfmoraes
tfmoraes / test_numpy_memmap.py
Created April 19, 2011 18:26
Testing numpy memmap with multiprocessing
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import multiprocessing
import numpy as np
def print_matrix(matrix):
print matrix
def main():
matrix = np.memmap('test.dat', dtype='int16', mode='w+', shape=(100, 100))