from hdfs import *
client = Client("http://192.168.248.10:9870", root="/", timeout=100)
#文件夹的操作
'''
print(client.list("/data/class2"))
client.makedirs("/data/class3")
print(client.list("/data"))
client.delete("/data/class1")
print(client.list("/data"))
client.rename("/data/class3", "/data/class33")
print(client.list("/data"))
'''
#文件的操作:上传 下载 读文件 改名、删除
#client.upload("/data/", "D:/hosts")
print(client.list("/data"))
#client.download("/data/class2/水浒传.txt", "D:/")
print(client.read("/data/hosts").read())