Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Parsing files in python

Reply
Thread Tools

Re: Parsing files in python

 
 
Kene Meniru
Guest
Posts: n/a
 
      12-24-2012
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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What libraries should I use for MIME parsing, XML parsing, and MySQL ? John Levine Ruby 0 02-02-2012 11:15 PM
[ANN] Parsing Tutorial and YARD 1.0: A C++ Parsing Framework Christopher Diggins C++ 0 07-09-2007 09:01 PM
[ANN] Parsing Tutorial and YARD 1.0: A C++ Parsing Framework Christopher Diggins C++ 0 07-09-2007 08:58 PM
SAX Parsing - Weird results when parsing content between tags. Naren XML 0 05-11-2004 07:25 PM
Perl expression for parsing CSV (ignoring parsing commas when in double quotes) GIMME Perl 2 02-11-2004 05:40 PM



Advertisments