-
Notifications
You must be signed in to change notification settings - Fork 265
Closed
Description
On the Usage page of read the docs you have this snippet under the section for multiple files
for filename in glob.glob('*.xml'):
print filename.ljust(60),
detector.reset()
for line in file(filename, 'rb'):
detector.feed(line)
if detector.done: break
detector.close()
print detector.result
When using with Python 3.7 I had to change the for loop on line 4 to use open instead of file:
for filename in glob.glob('*.xml'):
print(filename.ljust(60),)
detector.reset()
for line in open(filename, 'rb'):
detector.feed(line)
if detector.done: break
detector.close()
print(detector.result)
Metadata
Metadata
Assignees
Labels
No labels