problem with rotating code

Is there any way to make it rotate only 10 degrees?
The models are the ones that come with Danda3D.

from direct.showbase.DirectObject import DirectObject
import direct.directbase.DirectStart
from panda3d.core import Camera,PandaNode,NodePath
from direct.showbase.ShowBase import ShowBase
from import Actor
from direct.task import Task
import math
import sys
class GameEngine(DirectObject):
	def __init__(self):
		self.keyMap = {"left":0, "right":0, "up":0, "down":0}
		self.environ = loader.loadModel("models/environment")      
		self.player = Actor("models/ralph",{"run":"models/ralph-run","walk":"models/ralph-walk"})
		taskMgr.add(self.cameracontrol, "cameracontrol")
		self.floater = NodePath(PandaNode("floater"))
		self.accept("escape", sys.exit)
		self.accept("arrow_left", self.setKey, ["left",1])
		self.accept("arrow_right", self.setKey, ["right",1])
		self.accept("arrow_up", self.setKey, ["up",1])
		self.accept("arrow_down", self.setKey, ["down",1])		

	def setKey(self, key, value):
		self.keyMap[key] = value
	def cameracontrol(self, task):
		heading =
		x =
		y =
		z = 10
		if (self.keyMap["left"]!=0):
			heading =
			x = -hbase*math.cos((heading*(math.pi/180)))
			y = -hbase*math.sin((heading*(math.pi/180)))
		if (self.keyMap["right"]!=0):
			heading =	
			x = hbase*math.cos((heading*(math.pi/180)))
			y = hbase*math.sin((heading*(math.pi/180))),y,z)
		return Task.cont


make what rotate only 10 degrees…?

The purpose of this code is to allow the user to use the arrow keys (left and right at the moment)to move the camera around the player but remain a fixed distance away. However when i run this code it rotates about 90 degrees.

Looks like your code is trying to rotate by 1 degree:
then you use the new heading in your sin and cos.

The way it is set up with the camera at (-30,0,0) and Player at (0,0,0), after doing lookAt your get a heading of 90 deg, then you are basiclly calculating a new camera position using 90 + or - 1. Well, lets just say it’s 90 deg and you’ll see when you plug it in…
z = 10
x = -30math.cos((90(math.pi/180)))
y = -30math.sin((90(math.pi/180)))

x = 0, y = -30

so after the first press of arrow key you get

cam.setPos(0,-30,10) which is like a 90 deg rotation from your previous position.

try setting your initial camera position to (0.,-30,.0.)