我正在尝试用一些文本编写文本文件并在数据块中加载相同的文本文件,但我收到错误
代码
#write a file to DBFS using Python I/O APIs
with open("/dbfs/FileStore/tables/test_dbfs.txt", 'w') as f:
f.write("Apache Spark is awesome!\n")
f.write("End of example!")
# read the file
with open("/dbfs/tmp/test_dbfs.txt", "r") as f_read:
for line in f_read:
print(line)
错误 FileNotFoundError:[Errno 2] 没有这样的文件或目录:'/dbfs/FileStore/tables/test_dbfs.txt'