Question

Im new to python and zope. In the ZMI I have created a new python script with the following code:

the_message = 'hello there human'

print the_message

I am unable to save the file as it gives the error 'Prints, but never reads 'printed' variable'.

If I use return the_message then it saves and displays fine.

Does anyone know what is going wrong here? is there something I need to add to my script that im missing?

Was it helpful?

Solution

You need to explicitly return printed:

the_message = 'hello there human'

print the_message

return printed

The printed variable is not implicitly read. See Print Statement Support in the Basic Scripting chapter of the Zope 2 book.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top