Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e305953 + 15157e5 commit 1304508Copy full SHA for 1304508
2 files changed
galleries/examples/widgets/textbox.py
@@ -32,7 +32,7 @@ def submit(expression):
32
*expression* is a string using "t" as its independent variable, e.g.
33
"t ** 3".
34
"""
35
- ydata = eval(expression)
+ ydata = eval(expression, {'np': np}, {'t': t})
36
l.set_ydata(ydata)
37
ax.relim()
38
ax.autoscale_view()
lib/matplotlib/backends/qt_editor/_formlayout.py
@@ -41,6 +41,8 @@
41
__version__ = '1.0.10'
42
__license__ = __doc__
43
44
+from ast import literal_eval
45
+
46
import copy
47
import datetime
48
import logging
@@ -351,7 +353,7 @@ def get(self):
351
353
else:
352
354
value = date_.toPython()
355
- value = eval(str(field.text()))
356
+ value = literal_eval(str(field.text()))
357
valuelist.append(value)
358
return valuelist
359
0 commit comments