如何在.cpy文件(python)中打印?我正在使用Zope/Plone,而我刚开始使用Python.我已经尝试过了
How to print in a .cpy file (python) ? I'm using Zope/Plone and I've just started with Python. I've tried this
import logging logger = logging.getLogger() logger.info("hello plone")但这是行不通的.
谢谢您的回答
推荐答案上面的答案意味着您不能在RestrictedPython脚本(可通过Web编辑的Plone脚本)中导入任何模块.这些脚本具有最终用户权限,因此不允许运行任意Python代码.
The answer above means that you cannot import any modules in RestrictedPython scripts which are through-the-web editable Plone scripts. These scripts have end-user permissions, so they are not allowed to run arbitrary Python code.
collective-docs.readthedocs/en/Latest/security/sandboxing.html
您可以在受限制的python脚本中使用context.plone_log("mystring")样式日志记录,以进行记录.
You can use context.plone_log("mystring") style logging in restricted python scripts for logging purposes.
更多推荐
Logger在Plone的RestrictedPython脚本中可以正常工作
发布评论