Editing Python source as XML?

Steven Haryanto steven at haryan.to
Fri Mar 2 23:51:42 EST 2001


I am resending this to the list. Also thanks for the other
responses.

>Date: Sat, 03 Mar 2001 01:23:38 +0700
>To: Martin von Loewis <loewis at informatik.hu-berlin.de>
>From: Steven Haryanto <steven at haryan.to>
>Subject: Re: Editing Python source as XML?
>
>At 11:10 PM 3/2/2001, you wrote:
>>Steven Haryanto <steven at haryan.to> writes:
>>
>> > A recent experience of having to modify a long C source file has
>> > led me to wonder whether there are any tool/effort towards editing
>> > Python source code as XML or other form of structured document.
>>
>>Not sure *why* you'd want to do that, but it is certainly possible to
>>convert any script automatically to an XML document with the help of
>>the parser module.
>
>Creating a DTD that matches the Python grammar and editing the
>XML source code in a validating XML editor gives, among others,
>the comfort of on-the-fly syntax checking and eliminate the
>necessity to indent manually :-)
>
>> > What I would like is an editor that presents the source file as a
>> > tree outline, where I can collapse selected class or function
>> > definition body, certain long if's/for's, some section of code,
>> > view/hide the asserts, etc.
>>
>>PythonWin, and the Emacs Python mode, both can do that today.
>
><Slap in the forehead> Never knew that before! Guess I will
>be using Pythonwin a lot from now on :-)
>
>What about collapsing/expanding some logical section of code,
>is there another way beside:
>
>  # the following several pages of code does this & that
>  if 1:
>      # code
>
>      # code
>
>      # code
>
>Thanks,
>Steve
>
>>Regards,
>>Martin





More information about the Python-list mailing list