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()
python连接hdfs
原文:http://www.cnblogs.com/kayy/p/7755770.html