Am I not seeing the Error?

Ned Batchelder ned at nedbatchelder.com
Tue Aug 13 20:00:57 EDT 2013


On 8/13/13 5:16 PM, Dave Angel wrote:
> Denis McMahon wrote:
>
>> On Sat, 10 Aug 2013 22:19:23 -0400, Devyn Collier Johnson wrote:
>>
>>> I am checking my 1292-line script for syntax errors. I ran the following
>>> commands in a terminal to check for errors, but I do not see the error.
>>> JOB_WRITEURGFILES =
>>> multiprocessing.Process(write2file('./mem/ENGINE_PID', ENGINEPID);
>>> write2file(SENTEMPPATH, ''); write2file(INPUTMEM, ''));
>>> JOB_WRITEURGFILES.start()
>> When I expand this out to one item per line,
>>
>> JOB_WRITEURGFILES =
>> 	multiprocessing.Process
>> 	(
>> 		write2file
>> 		(
>> 			'./mem/ENGINE_PID'
>> 			,
>> 			ENGINEPID
>> 		)
>> 		;
>> 		write2file
>> 		(
>> 			SENTEMPPATH
>> 			,
>> 			''
>> 		)
>> 		;
>> 		write2file
>> 		(
>> 			INPUTMEM
>> 			,
>> 			''
>> 		)
>> 	)
>> ;
>> JOB_WRITEURGFILES.start()
>>
>> and I wonder (not being familiar with multiprocessing) if perhaps there
>> should have been a third ";" after the third write2file in the job
>> definition.
>>
> The mistake is not that it's missing the 3rd, but that the first two
> semicolons  should have been commas. These are parameters to a function
> call multiprocessing.Process()
Everyone: this program seems to be a direct and misguided 
transliteration from a bash script.  There are dozens of mis-uses like 
this of multiprocessing.Process(), due to a severe misunderstanding of 
what it does and how it works.

We've tried offering help, and all that's happened is we've been told 
that this strange coding style is easier to read.

--Ned.





More information about the Python-list mailing list