ProvoWallis wrote:
...
> for root, dirs, files in os.walk(setpath):
> fname = files
> for fname in files:
> inputFile = file(os.path.join(root,fname), 'r')
> while 1:
>lines = inputFile.readlines(1)
>if not lines:
>
> I'm not sure what I'm
> missing so I'd appreciate some advice.
You question is pretty general and I'm not going to go over this in any
great detail, but I will make a few comments.
* In your if section use if ... else constructs not all the strange if
and then not if blocks. Also get rid
Hi,
I'm trying to create a script that will search an SGML file for the
numbers and titles of the hierarchical elements (section level
headings) and create a dictionary with the section number as the key
and the title as the value.
I've managed to make some progress but I'd like to get some gener