Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'one?': 0.05; 'assignment': 0.07; 'string': 0.09; 'exit': 0.09; 'sure,': 0.09; 'python': 0.11; '"is': 0.16; 'grep': 0.16; 'implies': 0.16; 'program?': 0.16; 'simpler,': 0.16; 'stdout': 0.16; 'subject:threads': 0.16; 'threads,': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'trying': 0.19; 'command': 0.22; 'separate': 0.22; 'print': 0.22; 'header:User- Agent:1': 0.23; 'apply.': 0.24; 'questions:': 0.24; 'define': 0.26; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'friends,': 0.30; "i'm": 0.30; '(which': 0.31; 'code': 0.31; 'though.': 0.31; 'running': 0.33; 'sense': 0.34; 'could': 0.34; 'subject:with': 0.35; "who's": 0.35; 'doing': 0.36; 'step': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'flow': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; 'success': 0.61; 'simple': 0.61; 'real': 0.63; 'become': 0.64; 'school': 0.64; 'received:74.208': 0.68; 'ing': 0.84; 'received:74.208.4.194': 0.84; 'on?': 0.91 Date: Wed, 07 Jan 2015 21:18:06 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Playing with threads References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:vdMSRZ/9ybJt6kzJho7GHFf976Fb/VkRx55SmW9cQpY vs74ff99k1PSuzx01wqFpkyMEHto1ry6rDkZ7I+bTFgvngbSYA 11xrTMLx4Kd5PhVU9vvNQvDcol2NRzPIgioRKx3paLsVFhhkeo 0mTS4bD7qPPBJN7OPSva2QlFOOx/Anmj86bWdi91DXrsUwKBCP X+hKsmno2SQQ+o9+ESZKLiXy3msE09F5xaEDLZzPxx/vVQVilz 1W5uK2FPpVQTmGFS9hTRwbj9shHnZVZ02018UZm5dfodOe6cZk rONkS75Ll8AO2G9L7WXpVwTRwBY0tHP+EZbHfaPsyZjiqe/BJ6 3YexLesgsYwH2/hgnKt0= X-UI-Out-Filterresults: notjunk:1; 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: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1420683553 news.xs4all.nl 2927 [2001:888:2000:d::a6]:56289 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:83313 On 01/07/2015 09:00 PM, Ganesh Pal wrote: > Hi friends, > > I'm trying to use threads to achieve the below work flow > > 1. Start a process , while its running grep for a string 1 > 2. Apply the string 1 to the command in step 1 and exit step 2 > 3. Monitor the stdout of step1 and print success if the is pattern found > None of those three "statements" make sense to me. Could you translate, or elaborate? And fix typos? What OS is this running on? Is the process a program called grep.exe? Or a second Python program? Who's doing the grep, that separate program or your original one? Define Apply. What's it mean to apply a string to a command? What's an "is pattern" ? And who's looking for it? What's the real goal? Or is this just a paraphrasing of an arbitrary school assignment (which don't always make sense). > Questions: > > 1. Can the above be achieved without threads ? I prefer keep ing code > simple .threads can become confusion when this workflow grows larger Sure, nothing in that description implies threads, just a separate process. No idea why that's simpler, though. -- DaveA