比如说现在有这么一段字符串,"print('helloworld')",那么怎么将其转换成python认识的格式运行?
s="print('helloworld')" r = compile(s,"<string>", "exec") exec(r)
输出:helloworld
比如说现在有这么一段字符串,"print('helloworld')",那么怎么将其转换成python认识的格式运行?
s="print('helloworld')" r = compile(s,"<string>", "exec") exec(r)
输出:helloworld
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M