Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'syntax': 0.04; 'continuation': 0.07; 'skip:\\ 20': 0.07; 'subject:Error': 0.07; "'')": 0.09; '[0]': 0.09; '__name__': 0.09; 'arguments': 0.09; 'collier': 0.09; 'constructor': 0.09; 'line:': 0.09; 'separating': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'def': 0.12; 'suggest': 0.14; "'');": 0.16; "'__main__':": 0.16; 'callable': 0.16; 'etc.),': 0.16; 'semi-colons': 0.16; 'substitute': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'trying': 0.19; 'aug': 0.22; 'rules': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'mon,': 0.24; 'cc:2**0': 0.24; 'equivalent': 0.26; 'this:': 0.26; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'along': 0.30; 'lines': 0.31; 'implicit': 0.31; 'int,': 0.31; 'yes.': 0.31; 'skip:m 30': 0.32; 'option': 0.32; 'quite': 0.32; 'url:python': 0.33; 'call.': 0.33; 'subject:the': 0.34; "i'd": 0.34; 'johnson': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'skip:j 20': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'should': 0.36; 'example,': 0.37; 'skip:m 40': 0.38; 'url:library': 0.38; 'list,': 0.38; 'little': 0.38; '12,': 0.39; 'how': 0.40; 'read': 0.60; 'url:3': 0.61; "you're": 0.61; 'first': 0.61; 'more': 0.64; 'different': 0.65; 'to:addr:gmail.com': 0.65; 'within': 0.65; 'note:': 0.66; 'due': 0.66; 'between': 0.67; 'skip:m 50': 0.68; 'subject': 0.69; 'obvious': 0.74; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=fMoipMS063TdOfOjboSTdgXwr6bo2c3bTO9HKjW+H6w=; b=mC0HJ6ZFFOZappQmJEaJbfkH+Y624MfAAKDeoAgMYFQh+I0tNAklxc5O8dsCuG+85N n930alVg/eZQ3z2eNtDa/jw+TIn+gzyql2Wq7sFBUF05q/pWp0MX56bdiMAJTD2BEAhN nFtAQeKbIPekEzuXzjnJNNPs8S6tiL+OjaciVM0MZJh2vbWnEuQCaQDSYreOGwG1eLEb arlmfmdIViVhOW67OQDeFPFFFaHCFKouE7VR4P1gDlxNcyGM14doN+fkU3cOFEQm2em7 WQPWMNN58xpzFUlJYaDWOqXe3wnP7ZwnQC+waVgWyM/s7oWmGgA9bXb10ZpzpmYOSrjO ImgA== X-Received: by 10.205.24.6 with SMTP id rc6mr3733715bkb.66.1376321861251; Mon, 12 Aug 2013 08:37:41 -0700 (PDT) MIME-Version: 1.0 Sender: zachary.ware@gmail.com In-Reply-To: <5208EB7E.6030907@Gmail.com> References: <5206F4AB.8050204@Gmail.com> <5208D625.2000103@Gmail.com> <5208EB7E.6030907@Gmail.com> From: Zachary Ware Date: Mon, 12 Aug 2013 10:37:21 -0500 X-Google-Sender-Auth: Fmn1iHWu2mDxooZtRGDLAfJYh7Q Subject: Re: Am I not seeing the Error? To: Devyn Collier Johnson Content-Type: text/plain; charset=UTF-8 Cc: Python Mailing List 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: 72 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1376322196 news.xs4all.nl 15866 [2001:888:2000:d::a6]:36618 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52419 On Mon, Aug 12, 2013 at 9:04 AM, Devyn Collier Johnson wrote: > > Zachary, are you, Ned, and Terry trying to say the syntax should be > > job = multiprocessing.Process(func1(), func2()) > > not > > job = multiprocessing.Process(func1(); func2()) > Basically, yes. The first option there is equivalent to this: func_returns = (func1(), func2()) job = multiprocessing.Process(*func_returns) The second option is equivalent to this: job = multiprocessing.Process(func1() func2()) ...which is actually several different syntax errors, depending on how you look at it. Semi-colon is only ever used in Python as a substitute for \n-plus-some-spaces. And, since in your original example, your semi-colons are inside parenthesis, they really have no effect at all due to implicit line continuation within parens. So your original line: JOB_WRITEURGFILES = multiprocessing.Process(write2file('./mem/ENGINE_PID', ENGINEPID); write2file(SENTEMPPATH, ''); write2file(INPUTMEM, '')); JOB_WRITEURGFILES.start() is really: JOB_WRITEURGFILES = multiprocessing.Process(write2file('./mem/ENGINE_PID', ENGINEPID) write2file(SENTEMPPATH, '') write2file(INPUTMEM, '')) JOB_WRITEURGFILES.start() It should be obvious now that the syntax error comes from not separating the arguments to Process. Trying to read between the lines a little here, I don't think you have quite figured out how multiprocessing.Process works; that first option above will only work if func1 returns None and func2 returns a callable object and the second has no hope. I think this is more along the lines of what you're really after: def process_func(): func1() func2() if __name__ == '__main__': job = multiprocessing.Process(target=process_func) # note: no () after process_func! job.start() I'd suggest giving the multiprocessing.Process docs [0] a good read-through. Keep in mind that Process is just a type like any other (str, int, list, etc.), and calling its constructor is subject to the same rules as any other function call. -- Zach [0] http://docs.python.org/3/library/multiprocessing#the-process-class