Python中文
首页
教程
问答
标签
搜索
登录
注册
eval、exec和compile之间有什么区别?
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我一直在研究Python代码的动态评估,遇到了<code>eval()</code>和<code>compile()</code>函数以及<code>exec</code>语句</p> <p>谁能解释一下<code>eval</code>和<code>exec</code>之间的区别,以及<code>compile()</code>的不同模式是如何适应的</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>exec是for语句,不返回任何内容。 eval用于表达式并返回表达式的值</p> <p>表达的意思是“某事”,而陈述的意思是“做某事”</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
得到媒体:缩略图url从rss源
10 回答
得到对数正态随机数给定log10均值和log10标准差
9 回答
得到工作,波斯特不
8 回答
得到左半积和右半积的绝对差最小的元素
8 回答
得到幻数错误?
9 回答
得到异常错误“线程中的异常-1(最有可能在解释器关闭期间引发)”,它使用Parami
10 回答
得到循环
9 回答
得到德语的语法变化
7 回答
得到我认为是好的结果,但还不够
8 回答
得到截断svd.transform()返回float16而不是float64
8 回答
得到所有不相交的集合的并集
7 回答
得到所有函数求值组合的矩阵
7 回答
得到扭曲延迟取消错误当使用刮痧时
2 回答
得到控制台.log使用Selenium python从Chrome输出一次,然后调用第二次为空
3 回答
得到操作系统环境通过NSSM运行Python
9 回答
得到数学方程中的表达式
4 回答
得到数据库结构属性
4 回答
得到整数的后三位
4 回答
得到整数的第n位精度
6 回答
得到最低落的reddit评论
1 回答