Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.023 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'subject:Python': 0.06; 'received:67.192': 0.09; 'received:67.192.241': 0.09; 'received:dfw.emailsrvr.com': 0.09; 'sure,': 0.09; 'subject:Help': 0.11; 'python': 0.11; '(use': 0.16; '.py': 0.16; '__init__.py': 0.16; 'extension.': 0.16; 'imports': 0.16; 'once.': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'help.': 0.21; 'import': 0.22; 'header:User-Agent:1': 0.23; 'received:emailsrvr.com': 0.24; 'received:(smtp server)': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'gary': 0.31; 'probably': 0.32; 'run': 0.32; 'actual': 0.34; 'trouble': 0.34; 'could': 0.34; 'subject:with': 0.35; 'but': 0.35; 'doubt': 0.36; 'module.': 0.36; 'doing': 0.36; 'thanks': 0.36; 'received:10': 0.37; 'to:addr:python-list': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'how': 0.40; 'skip:u 10': 0.60; 'tell': 0.60; 'first': 0.61; 'show': 0.63; 'more': 0.64; 'different': 0.65; 'charset:windows-1252': 0.65; 'determine': 0.67; 'started.': 0.68; 'cut': 0.74; 'received:10.10': 0.74; 'subject:skip:M 10': 0.84 X-Virus-Scanned: OK X-Sender-Id: gary.herron@islandtraining.com Date: Thu, 13 Nov 2014 11:12:22 -0800 From: Gary Herron User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Help with Python Multiprocessing References: <91fd5810-6a2a-46d8-8d1e-b68afced3987@googlegroups.com> In-Reply-To: <91fd5810-6a2a-46d8-8d1e-b68afced3987@googlegroups.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1415906534 news.xs4all.nl 2954 [2001:888:2000:d::a6]:39020 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:80698 On 11/13/2014 10:07 AM, Anurag wrote: > I am having trouble understanding the Multiprocessing module. > I need to run three different files 'Worker1' , 'Worker2', 'Worker3' all at once. Currently I am doing this : > > from multiprocessing import Process > > import Worker1.py > import Worker2.py > import Worker3.py > > > > p1 = Process(target=Worker1.py) > p1.start() > p2 = Process(target=Worker2.py) > p2.start() > p3 = Process(target=Worker3.py) > p3.start() > > But this will only start the 'Worker1'. How do I execute all the three files at once? > > Thanks I doubt that is your actual code. Python imports do not include .py extension. Please show us your actual code. (Use cut and paste please.) And then take the time to tell us how you determine only the first is started. Then we can probably help. As an aside: To be sure, one could make the above imports work by having files named py.py and __init__.py in a directory named Worker1 (and the same for directories Worker2 and Worker3). I think it's more likely that you miss-typed the above code. Gary Herron