Is raspberry pi required?

i want to make an autonomous drone using pixhawk 2.4.8, but videos on yt show that we require raspberry pi to run python code… is there any alternative to that … like can i run my py code directly in pixhawk ???

I don’t think so, you have to use either RPi or Intel boards. On the other hand, you can try Matlab simulation to flash your python code with px4 firmware.