Automatic px4 launch & kill

Hi all! I am trying to write a code on python that automatically opens and closes px4. I managed to successfully open px4, using subprocess or os library. However, when the script kills the px4 process, the python process is also automatically killed. Does anybody knows a way to kill px4 from python without killing the python process itself?
I am using gazebo 11 and v.1.11.3 of px4, with ROS noetic on Ubuntu 20