Runing a python script on mission planner using rpi

Hello everyone,

I have run one of the drone kit python scripts on mission planner and it works perfectly.
Now I have Raspberry Pi and Pixhawk and I would like to run the same code on Raspberry Pi and check the simulation on Mission Planner, Could anyone tell me please how can I do it?

I am still new to all of this and I have tried to watch some tutorials but haven’t figure out how to do it yet.

Any help would be appreciated,
Thank you guys in advance.