Thanks all. I think I'll follow the "don't do that" advice.
jr
Jacob Rael wrote:
> Hello,
>
> I have a simple script to parse a text file (a visual basic program)
> and convert key parts to tcl. Since I am only working on specific
> sections and I need it quick, I decided not to learn/try a full
Tim Hochberg wrote:
[snip]
> I agree that mixing the line assembly and parsing is probably a mistake
> although using next explicitly is fine as long as your careful with it.
> For instance, I would be wary to use the mixed for-loop, next strategy
> that some of the previous posts suggested. Here'
John Machin wrote:
> Jacob Rael wrote:
>> Hello,
>>
>> I have a simple script to parse a text file (a visual basic program)
>> and convert key parts to tcl. Since I am only working on specific
>> sections and I need it quick, I decided not to learn/try a full blown
>> parsing module. My simple scri
Jacob Rael wrote:
> Hello,
>
> I have a simple script to parse a text file (a visual basic program)
> and convert key parts to tcl. Since I am only working on specific
> sections and I need it quick, I decided not to learn/try a full blown
> parsing module. My simple script works well until it runs
Jacob Rael wrote:
[...]
> I would line to identify if a line continues (if line.endswith('_'))
> and concate with the next line:
>
> line = line + nextLine
>
> How can I get the next line when I am in a for loop using readlines?
Don't use readlines.
# NOT TESTED
program = open(fileName)
Jacob Rael wrote:
> Hello,
>
> I have a simple script to parse a text file (a visual basic program)
> and convert key parts to tcl. Since I am only working on specific
> sections and I need it quick, I decided not to learn/try a full blown
> parsing module. My simple script works well until it run
Hello,
I have a simple script to parse a text file (a visual basic program)
and convert key parts to tcl. Since I am only working on specific
sections and I need it quick, I decided not to learn/try a full blown
parsing module. My simple script works well until it runs into
functions that straddle