When I run the same python code in python.sh and in script editor, but it shows different result! Why?

I wanted to get the output of contact sensor, so I found a python code from Omniverse IsaacSim tutorials.
I can run the result by issac sim script editor as follows. But, when I run the same code by python.sh, It showed error! Why? Has anyone encountered the same problem before? @rthaker @Richard3D

@rthaker @Richard3D Has anyone encountered the same situation with me?

The script is in a format that can be launched from the script editor on the Isaac Sim App, not from python.sh.
To launch from python.sh, the script should be rewritten using standalone_examples as a reference.

Hi @728034416 - Here’s a documentation for standalone example scripts: Python Environment — Omniverse IsaacSim latest documentation