I am rather new to pymol. Now, I want to use it as a module withing a python script but importing the module brings up the GUI when I execute the script. See below the toy script:

from pymol import cmd

This script, when executed in my machine, will pop up the GUI. How can I prevent this?