Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python,': 0.01; 'log:': 0.04; 'skip:v 30': 0.04; 'python': 0.08; 'curious.': 0.09; 'dive': 0.09; 'subject:parsing': 0.09; 'url:github': 0.09; 'am,': 0.13; 'wrote:': 0.15; '--version': 0.16; '3.2.1': 0.16; 'brackets': 0.16; 'perhaps,': 0.16; 'py3': 0.16; 'received:192.168.1.40': 0.16; 'sane': 0.16; 'matching': 0.16; "doesn't": 0.22; 'header:In- Reply-To:1': 0.22; 'replacing': 0.23; 'code': 0.24; 'windows': 0.26; 'thanks.': 0.26; "i'm": 0.27; 'work.': 0.28; 'lee': 0.28; 'exit': 0.29; 'shell': 0.29; 'cant': 0.30; 'version': 0.30; 'seem': 0.31; 'print': 0.32; 'named': 0.32; 'it.': 0.33; 'to:addr :python-list': 0.34; 'header:User-Agent:1': 0.34; 'test': 0.34; 'version.': 0.35; "isn't": 0.35; 'file': 0.36; 'some': 0.37; 'could': 0.37; 'received:192': 0.38; 'subject:: ': 0.38; 'strong': 0.38; 'else': 0.38; 'run': 0.39; 'received:192.168.1': 0.39; 'version:': 0.39; 'skip:e 20': 0.39; 'to:addr:python.org': 0.39; 'did': 0.40; "i'd": 0.40; 'your': 0.60; 'received:62': 0.67; 'anything.': 0.71; 'subjectcharset:utf-8': 0.72; '11:14': 0.84; 'content:': 0.84; 'from:addr:t': 0.84; 'skip:~ 30': 0.84; 'stdout?': 0.84; 'xah': 0.84; 'subject:little': 0.91 Date: Thu, 21 Jul 2011 15:21:25 +0200 From: Thomas Jollans User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110626 Iceowl/1.0b2 Icedove/3.1.11 MIME-Version: 1.0 To: python-list@python.org Subject: Re: a little parsing challenge =?UTF-8?B?4pi6?= References: <36037253-086b-4467-a1db-9492d3772e78@r5g2000prf.googlegroups.com> <7ae55705-6342-4f06-add8-59de05d111b9@x12g2000yql.googlegroups.com> <22a6d549-b490-4534-a076-94cb6f21f8ce@h7g2000prf.googlegroups.com> <1fac9c74-33ea-4380-a060-d20ee5aff971@s33g2000prg.googlegroups.com> In-Reply-To: <1fac9c74-33ea-4380-a060-d20ee5aff971@s33g2000prg.googlegroups.com> X-Enigmail-Version: 1.1.2 OpenPGP: id=5C8691ED Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 53 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1311254485 news.xs4all.nl 23961 [2001:888:2000:d::a6]:50385 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:10022 On 21/07/11 14:29, Xah Lee wrote: > On Jul 19, 11:14 am, Thomas Jollans wrote: >> I thought I'd have some fun with multi-processing: > > Nice joke. ☺ > >> Here's a sane version: >> >> https://gist.github.com/1087682/2240a0834463d490c29ed0f794ad15128849ff8e > > hi thomas, > > i still cant get your code to work. I have a dir named xxdir with a > single test file xx.txt,with this content: > > foo[(])bar > > when i run your code > py3 validate_brackets_Thomas_Jollans_2.py > > it simply exit and doesn't seem to do anything. I modded your code to > print the file name it's proccessing. Apparently it did process it. > > my python isn't strong else i'd dive in. Thanks. Curious. Perhaps, in the Windows version of Python, subprocesses don't use the same stdout? Windows doesn't have fork() (how could they survive?), so who knows. Try replacing ex.submit(process_file, fullname) with process_file(fullname) for a non-concurrent version. > > I'm on Python 3.2.1. Here's a shell log: > > h3@H3-HP 2011-07-21 05:20:30 ~/web/xxst/find_elisp/validate matching > brackets > py3 validate_brackets_Thomas_Jollans_2.py > h3@H3-HP 2011-07-21 05:20:34 ~/web/xxst/find_elisp/validate matching > brackets > py3 validate_brackets_Thomas_Jollans_2.py > c:/Users/h3/web/xxst/find_elisp/validate matching brackets/xxdir > \xx.txt > h3@H3-HP 2011-07-21 05:21:59 ~/web/xxst/find_elisp/validate matching > brackets > py3 --version > Python 3.2.1 > h3@H3-HP 2011-07-21 05:27:03 ~/web/xxst/find_elisp/validate matching > brackets > > Xah