【发布时间】:2020-05-04 14:37:32
【问题描述】:
当我运行我的代码时,出现语法错误,我不知道为什么。当然我成功安装了 Functions 模块,但是出现了这个错误。
%pylab inline
%matplotlib notebook
rcParams["figure.figsize"]=12,8
from functions import circles,deposit_particles,create_envelope,create_envelope_selected
from ipywidgets import interact
from ipywidgets.widgets import IntSlider,IntText,Label,VBox,HBox,Layout,Button,FloatSlider,ToggleButton,FloatText
from IPython.display import clear_output,display
'''
the error:
'''
Populating the interactive namespace from numpy and matplotlib
Traceback (most recent call last):
File "C:\Users\Win 8.1\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3326, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-3-1f3efd9a314f>", line 10, in <module>
from functions import circles,deposit_particles,create_envelope,create_envelope_selected
File "C:\Users\Win 8.1\Anaconda3\lib\site-packages\functions.py", line 68
nodes = tuple(map(lambda (k, v): process_node(inner, k, v),
^
SyntaxError: invalid syntax
【问题讨论】:
-
见stackoverflow.com/questions/15712210/…。从 Python 3 开始,此语法无效。
-
这个错误返回“from functions import”可能是导入有问题?
标签: python