Creating cycles background light (world lighting) from Python
This does work on my machine though, I've tested it. Note here i've used aliasing to make the lines less long.

my_script.py

import bpy
import time
import os

bpy.data.scenes['Scene'].render.engine = 'CYCLES'
world = bpy.data.worlds['World']
world.use_nodes = True

# changing these values does affect the render.
bg = world.node_tree.nodes['Background']
bg.inputs[0].default_value[:3] = (0.5, .1, 0.6)
bg.inputs[1].default_value = 1.0

bpy.ops.render.render()

faux_name = "tensor_" + str(time.time()) + ".png"
fp = os.path.join("/home/zeffii/Desktop", faux_name)
bpy.data.images['Render Result'].save_render(filepath=fp)