from hdfs.client import Client
client = Client("http://localhost:50070")
print client.list('/')
 
hdfs_dir = '/data/hive/warehouse'
with client.read(hdfs_dir) as f:
    print f.read()