This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from multiprocessing import Process | |
def func1(): | |
for i in range(0, 1000): | |
print i | |
def func2(): | |
print "hello world" | |
if __name__ == '__main__': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Yunhan Li | |
# Example of processing large data file without running out of memory. | |
import sys, os, time | |
def processFile(filename, output): | |
bufferlimit = 10000 | |
buffer = [] | |
start_tic = time.clock() |