How do I set my camera rotation with Python? I'm working on an automatic renderer script, and I have some trouble setting the rotation of my camera. I suspect it has something to do with the need for me to convert the rotation values I want to quaternion values. The problem is that I am absolutely hopeless in maths and not very advanced in programming, I'm still learning. I have been looking on the internet but I have found very complex things such as this :

https://blenderartists.org/t/questions-about-python-controlled-camera-rotation-and-location-in-blender-2-59/520639

But I don't know where to start, I don't get what the code means and I don't know how to implement that to my case, so I figured it was best to ask from scratch.

SO basically I want my camera to have the same rotation I have created manually, that is to say :
x= 66.9
y= 0
z= 28.9

Here's the last thing I have tried:

import bpy
import os
import math
import shutil
import glob
import bmesh
import mathutils

    #Camera position
    Camera = bpy.data.objects["Camera"]

    pos= [24.408, -39.401, 33.853]
    rot= [66.9, -0.000115, 28.9]

    Camera.location.x = pos[0]
    Camera.location.y = pos[1]
    Camera.location.z = pos[2]

    Camera.rotation_mode = 'XYZ'
    Camera.rotation_euler[0] = rot[0]
    Camera.rotation_euler[1] = rot[1]
    Camera.rotation_euler[2] = rot[2]

    Camera.rotation_euler.to_quaternion()


And errr.... it doesn't work at all lol, it puts my camera at 3833° X, -0.00661° Y and 1656° Z...

Can someone help me ?

Thank you so much :)
def setupCamera(scene, c):
    pi = math.pi

    scene.camera.rotation_euler[0] = c[0] * (pi / 180.0)
    scene.camera.rotation_euler[1] = c[1] * (pi / 180.0)
    scene.camera.rotation_euler[2] = c[2] * (pi / 180.0)

    scene.camera.location.x = c[3]
    scene.camera.location.y = c[4]
    scene.camera.location.z = c[5]

    return

scene = bpy.data.scenes["Scene"]

config = list([67.1349, 0.779594, 148.858, 5.57961, 9.16202, 5.34536])

bpy.ops.object.camera_add()
cam = bpy.data.objects['Camera']
cam.rotation_mode = 'XYZ'

scene.camera = cam

setupCamera(scene=scene, c=config)