Skip to content
Advertisement

Reading multiple log files from a folder using python

In the past I have read a log file using python with the following code, which has always worked fine:

JavaScript

For a particular use case that I am working on, I need to read multiple files contained in a folder. Can someone please suggest how to modify the above code (I tried that using blob but could not succeed)? Thanks in advance.

Advertisement

Answer

How’s this?

JavaScript

Docs on os.listdir()

Advertisement