The easiest way to do this would be using UART for serial communication. The CC3D has TX/RX/GND pins which you connect to Raspberry Pi.
Now you will need some sort of protocol or data framing to send pitch/roll/yaw/throttle values to the flight controller and differentiate these values somehow. You can implement and use the MultiWii Serial Protocol for this purpose. Flight controller firmware such as CleanFlight already support MSP. On the RaspPi, PyMultiWii can be used to handle MSP frames.
What is the format or range of the controls the python script decides for the quadcopter? You will have to convert or map these values into MSP RC frame format. The pitch/roll/yaw/throttle range in MSP is 1000-2000 (centered at 1500 at pitch/roll/yaw) and 1000 for throttle stops all motors and 2000 is the max value for throttle. The RC frame also support 4 AUX channels, where you can send any sort of data you want. Here's a good tutorial for implementing MSP with python and STM32 microntroller (which is used on CC3D).
Tip: You can also make use of the MSP attitude and heading frame to get the pitch, roll and yaw computed from the IMU on the flight controller and integrate this with your Python script on RaspPi for better control!
