Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

multiprocessing a for loop python

from multiprocessing import Pool

def process_image(name):
    sci=fits.open('{}.fits'.format(name))
    <process>

if __name__ == '__main__':
    pool = Pool()                         # Create a multiprocessing Pool
    pool.map(process_image, data_inputs)  # process data_inputs iterable with pool
Comment

PREVIOUS NEXT
Code Example
Python :: python array from 1 to n 
Python :: csv writer python 
Python :: remove extra spaces and empty lines from string python 
Python :: how to change plot size in matplotlib 
Python :: python random list 
Python :: hstack in numpy 
Python :: pyhon random number 
Python :: python spotify player 
Python :: python code to receive gmail 
Python :: python remove key from dict 
Python :: how to get bot voice channel discord.py 
Python :: add two list in python 
Python :: how to use elif in python 
Python :: python set remove if exists 
Python :: find sum of 2 numbers in array using python 
Python :: python validate url 
Python :: discord.py how to print audit logs 
Python :: How to do train test split in keras Imagedatagenerator 
Python :: python pip jupyter notebook install 
Python :: how to open a file with python 
Python :: plot second axis plotly 
Python :: create square matrix python 
Python :: multiline comment python 
Python :: python shortest distance between two points 
Python :: how to edit messages in discord . py 
Python :: df .sort_values 
Python :: pygame window at center 
Python :: drawing arrows in tkinter 
Python :: python private 
Python :: Python program to print all odd numbers in a range 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =