Re: Parsing files in python

Discussion in 'Python' started by Chris Angelico, Dec 24, 2012.

  1. 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
    Chris Angelico, Dec 24, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GIMME
    Replies:
    2
    Views:
    873
    GIMME
    Feb 11, 2004
  2. Naren
    Replies:
    0
    Views:
    579
    Naren
    May 11, 2004
  3. Christopher Diggins
    Replies:
    0
    Views:
    609
    Christopher Diggins
    Jul 9, 2007
  4. Christopher Diggins
    Replies:
    0
    Views:
    433
    Christopher Diggins
    Jul 9, 2007
  5. John Levine
    Replies:
    0
    Views:
    729
    John Levine
    Feb 2, 2012
Loading...

Share This Page