“python script failed check the message in the system console” in Blender

This is for beginners.

Error Detail

When I ran python script below in blender, the error message “python script failed check the message in the system console” is displayed.

import bpy.data
print(bpy.data.objects)
from Blender

Solution

Open the system console and check the message but where is the system console?

How to open the system console

Click Window > Toggle System Console

You can see the message on the generated window.