Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #35448

Re: Parsing files in python

References <20121223171955.GB32535@ifeobi.illom.net> <CAPTjJmrWAZbb-rmxyCfc3RerK75s4ar0RY2ZCuy5o6PBOVMm6w@mail.gmail.com> <50d82440.d441340a.3779.ffffe491@mx.google.com>
Date 2012-12-24 20:53 +1100
Subject Re: Parsing files in python
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1246.1356342814.29569.python-list@python.org> (permalink)

Show all headers | View raw


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 <kene.meniru@illom.org> 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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Parsing files in python Chris Angelico <rosuav@gmail.com> - 2012-12-24 20:53 +1100

csiph-web