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")
But it doesn’t work.
Thank you for your answer
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.
http://collective-docs.readthedocs.org/en/latest/security/sandboxing.html
You can use
context.plone_log("mystring")style logging in restricted python scripts for logging purposes.