python读取文件和写入文件的方式

发布时间 2023-06-15 21:38:43作者: 苹果芒
 path=os.path.realpath(__file__)
 cwd=os.path.split(path)[0]
 open(cwd+os.path.sep+"usage_result.xls","wb").write(response.content)

上面是写入文件的方式。

那么如果读取文件呢,比如 python如何读取一个excel文件内容呢: