Determining blender commands to be used in python scripts?

How do I determine the proper commands to be added to a python script to control blender? Say, I want to write a python script that sets my material color differently or modifies an object or something… is there a way to do that action in blender and see the blender related code to do it? As an example, here is some code that selects a camera:

Scene.getCurrent().setCurrentCamera(Object.Get(“Camera01”))

Now, how did you guys come up with that? In this specific instance, I am trying to modify the resolution settings to a different number. But, I thought I’d ask you guys how to fish rather than just asking for a fish.

reap

perhaps you should consult Blender’s Python API Reference to get the proper commands and syntax.
http://www.blender.org/documentation/blender_python_API_2.40.tar.gz

for further python specific questions you may go to the python forum here in this place
https://blenderartists.org/forum/viewforum.php?f=5

Thanks, I’ll start reading through there and I also posted my specific question here:

https://blenderartists.org/forum/viewtopic.php?p=537236#537236

Scene.getCurrent().setCurrentCamera(Object.Get(“Camera01”))

This is just standard Object Oriented programming trickery. Functions (methods) like Object.Get() return an actual object and not just a value like sin() or sqrt(). This means you can chain commands together like the example shows.

Another way to write the code snippet above is to break it down into its component parts:

cam = Object.Get(“Camera01”)
scene = Scene.getCurrent()
scene.setCurrentCamera( cam )