Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

run multiple function with multiprocessing python

from multiprocessing import Process
import sys

rocket = 0

def func1():
    global rocket
    print ('start func1')
    while rocket < sys.maxsize:
        rocket += 1
    print ('end func1')

def func2():
    global rocket
    print ('start func2')
    while rocket < sys.maxsize:
        rocket += 1
    print ('end func2')

if __name__=='__main__':
    p1 = Process(target=func1)
    p1.start()
    p2 = Process(target=func2)
    p2.start()
Comment

PREVIOUS NEXT
Code Example
Python :: merge three dataframes pandas based on column 
Python :: curl in python 
Python :: ip condition in tpl 
Python :: random number pythob 
Python :: python function to scale selected features in a dataframe pandas 
Python :: python tkinter getting labels 
Python :: pyqt5 close event 
Python :: numpy round to int 
Python :: duplicate data in python 
Python :: delete n from textpython 
Python :: sort a string in python 
Python :: how to check type inside a list in python 
Python :: random string generate python of 2.7 
Python :: isnumeric 
Python :: odoo scaffold 
Python :: exit in python 
Python :: how to know the length of a dataset tensorflow 
Python :: make screen shot of specific part of screen python 
Python :: reportlab page size a4 
Python :: change dataframe value by index 
Python :: python create env ubuntu 
Python :: make a nested list flat python 
Python :: Add Border to input Pysimplegui 
Python :: python string to datetime object 
Python :: error command errored out with exit status 1 face_recognition 
Python :: how to run linux command in python 
Python :: python code to receive gmail 
Python :: failed to execute script 
Python :: timedelta 
Python :: tensor to int python 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =