Python subclassing process with parameter
问题 I'm trying to create an object but as a new process. I'm following this guide and came up with this code. import multiprocessing as mp import time class My_class(mp.Process): def run(self): print self.name, "created" time.sleep(10) print self.name, "exiting" self.x() def x(self): print self.name, "X" if __name__ == '__main__': print 'main started' p1=My_class() p2=My_class() p1.start() p2.start() print 'main exited' But here I'm unable to pass arguments to the object. I searched but found