1 写入py文件
%%file hello.py
def func_inside_script(x, y):
return x + y*x
print('Hello World')

2 运行py文件
%run hello.py

无法嵌套运行
%%file hello2.py
%run hello.py
#def func_inside_script(x, y):
# return x + y*x
print('Hello World 2')
Writing hello2.py
%run hello2.py
SyntaxError: invalid syntax
版权声明:本文为weixin_45288557原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。