Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'output': 0.04; 'modify': 0.05; 'python': 0.09; 'macros': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'stdout': 0.09; 'subject:files': 0.09; 'subject:python': 0.11; 'dec': 0.15; 'producing': 0.15; '"import"': 0.16; '24,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'saying.': 0.16; 'top-level': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'script.': 0.17; 'saying': 0.18; '>>>': 0.18; 'module': 0.19; 'import': 0.21; 'meant': 0.21; 'not,': 0.21; 'parse': 0.22; 'header:User-Agent:1': 0.26; 'environment.': 0.27; 'easiest': 0.27; 'header:X-Complaints-To:1': 0.28; 'chris': 0.28; "i'm": 0.29; 'maybe': 0.29; 'classes': 0.30; 'file': 0.32; 'message.': 0.33; 'received:comcast.net': 0.33; 'to:addr:python-list': 0.33; 'text': 0.34; 'described': 0.35; 'pm,': 0.35; 'similar': 0.35; 'there': 0.35; 'received:org': 0.36; 'but': 0.36; 'two': 0.37; 'quite': 0.37; 'rather': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'mean': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'think': 0.40; 'skip:u 10': 0.60; 'most': 0.61; 'export': 0.62; 'repeat': 0.62; 'afraid': 0.66; 'header:Reply-To:1': 0.68; 'wish': 0.70; 'reply-to:no real name:2**0': 0.72; 'hoping': 0.72; 'actually,': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Kene Meniru Subject: Re: Parsing files in python Followup-To: gmane.comp.python.general Date: Mon, 24 Dec 2012 05:32:29 -0500 Organization: illom.org References: <20121223171955.GB32535@ifeobi.illom.net> <50d82440.d441340a.3779.ffffe491@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: c-69-143-75-245.hsd1.md.comcast.net User-Agent: KNode/4.4.7 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Kene.Meniru@illom.org 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: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1356345894 news.xs4all.nl 6976 [2001:888:2000:d::a6]:55327 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35451 Chris Angelico wrote: > I'm hoping you meant for that to be public; if not, my apologies for > forwarding a private message. > > On Mon, Dec 24, 2012 at 8:45 PM, Kene Meniru > wrote: >> Chris Angelico wrote: >>> from povray_macros import * >>> >> >> Am afraid you misunderstood my post. The file format I described is not >> an attempt to re-create or modify a python environment. I do not wish to >> be able to "import" python macros but other text files similar to the one >> I described. > > Yep. There are two possibilities: Either you create a program that > reads in a file of format you invent, or you make a set of Python > functions and classes that mean that the format is actually a Python > script. Instead of writing a file parser, you use Python's, and the > program you write is actually a module rather than a top-level > application. > Actually, I think I mean what you are saying. Let me repeat what I understand maybe I am understanding it wrong. You are saying I can create a python module that can parse this file format without using a system like python-ply? I know how to parse strings using python but considering that text files that describe a whole building may be quite large I thought perhaps the re module may not be adequate. > Producing output on stdout is one of the easiest and most standard > ways to export content. > > ChrisA