我正在尝试在databricks笔记本上运行python3的一些魔术命令。
例如,
在单元格1中:
%%writefile testMagic.py
def f():
print('I am function f')
f()
输出:
Writing testMagic.py
在单元格2中:
%pycat testMajic.py
输出:
def f():
print('I am function f')
f()
在单元格3中:
%run testMagic.py
输出:
Notebook not found: testMagic.py.
Notebooks can be specified via a relative path (./Notebook or ../folder/Notebook)
or via an absolute path (/Abs/Path/to/Notebook).
Make sure you are specifying the path correctly.
我尝试过:
%run /databricks/driver/testMagic.py
/databricks/driver/ is the current working dir by %pwd
同样的错误。
如何运行保存的文件?
谢谢