I don't think that's the only answer. I have been able to use PyMOL and Python scripts. I have no experience with ipymol.
(There's a difference.
.pml are pymol scripts.
There's a different syntax and set of commands when you are using Python to interact with PyMOL.)
Go to pymol-binder and click launch binder. The sessions that launch show making scripts and running them in several examples.
Those examples should help you in running things in your situation.