1 Replies - 178 Views - Last Post: 17 August 2014 - 11:21 AM Rate Topic: -----

#1 DK3250  Icon User is offline

  • D.I.C Head

Reputation: 27
  • View blog
  • Posts: 105
  • Joined: 27-December 13

Multiprocessing in Python 3.3

Posted 17 August 2014 - 07:50 AM

According to litterature this program should work with Python 3.3, printing the line definned in the run-method.
Problem is that the program executes without error, printing the final 'End', but without running the method.
import multiprocessing, time

class Process(multiprocessing.Process):
    def __init__(self, id):
        super(Process, self).__init__()
        self.id = id

    def run(self):
        time.sleep(1)
        print("I'm the process with id: {}".format(self.id))

if __name__ == '__main__':
    p = Process(0)
    p.start()
    p.join()
    print("End")



I have tried to simplify the program to the minimum, with the same result. The simplified version:
import multiprocessing, time

def ru(x):
    time.sleep(1)
    print("I'm the process with id: {}".format(x))

if __name__ == '__main__':
    p = multiprocessing.Process(target = ru, args = (0, ))
    p.start()
    p.join()
    print("End")


Input are most welcome.

This post has been edited by DK3250: 17 August 2014 - 08:46 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Multiprocessing in Python 3.3

#2 DK3250  Icon User is offline

  • D.I.C Head

Reputation: 27
  • View blog
  • Posts: 105
  • Joined: 27-December 13

Re: Multiprocessing in Python 3.3

Posted 17 August 2014 - 11:21 AM

Oh, I see now (after some more trials) that this must be an IDLE issue. If I use a pygame display for printing it works fine.
So, new question: What (free) editor for Python should I use in stead of IDLE ? I'm running Windows 7 and don't have Linux or iOS as possibilities.

This post has been edited by DK3250: 17 August 2014 - 01:28 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1