Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsfeed.xs4all.nl!newsfeed1.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'output': 0.04; 'modify': 0.05; 'python': 0.09; 'macros': 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; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'top- level': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'script.': 0.17; 'module': 0.19; 'import': 0.21; 'meant': 0.21; 'not,': 0.21; 'header:In-Reply-To:1': 0.25; 'environment.': 0.27; 'easiest': 0.27; 'message-id:@mail.gmail.com': 0.27; 'chris': 0.28; "i'm": 0.29; 'classes': 0.30; 'file': 0.32; 'message.': 0.33; 'to:addr :python-list': 0.33; 'received:google.com': 0.34; 'text': 0.34; 'described': 0.35; 'pm,': 0.35; 'received:209.85.220': 0.35; 'similar': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'but': 0.36; 'two': 0.37; 'rather': 0.37; 'received:209': 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; 'most': 0.61; 'export': 0.62; 'afraid': 0.66; 'wish': 0.70; 'hoping': 0.72 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=nbwfEMV2tLgNdOwygXxxigQwDa21gQA9P5sKZaW9zQU=; b=oS6HS9Q3b5GglD70S3D/z9ktlmIQQlFz9IviYOd67MVt90PP2Jth1jY2AaHhj9LKUv MphT7Ln7enuA+iEIgXH/g84RjgKkw08RGgIQVUqJIAQu5DUsXrEzUC+4i7OU+9aFTqgI hEYCzbTxWW7Gs1aNJZbkXZ7/1bDQfKU+9i1yc08p/a6wT/b131R2FOzDREn4k7yX77+w 1fE/wS4AP4FWyNHJRNE0fdK67BCNufYbTubr+5fNOxQBrtaswViyy3qDGE1qzD3PNw/6 ey7MuG57BSrEAaGHkYp3xWyfwMGtjiV8vSmuNJ+qSLGWFDpirJCdGGL+3UPPo+rHXFF1 AKDg== MIME-Version: 1.0 In-Reply-To: <50d82440.d441340a.3779.ffffe491@mx.google.com> References: <20121223171955.GB32535@ifeobi.illom.net> <50d82440.d441340a.3779.ffffe491@mx.google.com> Date: Mon, 24 Dec 2012 20:53:26 +1100 Subject: Re: Parsing files in python From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1356342814 news.xs4all.nl 6848 [2001:888:2000:d::a6]:42350 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35448 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. Producing output on stdout is one of the easiest and most standard ways to export content. ChrisA