search

Home  >  Q&A  >  body text

python from fileutils import FileUtils file operations

In a py script, it was found that FileUtils is used to read files, but it was not found in doc.python.
Is this the api library of apache? How should I download and use it?

from fileutils import FileUtils

for line in FileUtils.getLines('result.txt'):
为情所困为情所困2755 days ago521

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-05-18 11:03:44

    This should be a self-encapsulated package, not built into Python
    Python already supports file operations very well. If you want to read files, you can do this:

    with open('result.txt', 'r') as f:
        for line in r:
            print line

    reply
    0
  • Cancelreply