How to put together a driver with python
This is a general function I use in many of my scripts for adding drivers. You're welcome to implement it in your own script. It's pretty general and supports inverse relationships between properties (if one property goes up, the driven property goes down by the same amount), and also adding functions to the scripted expression (such as sin, cos, max, round, radians, etc).

def add_driver(
        source, target, prop, dataPath,
        index = -1, negative = False, func = ''
    ):
    ''' Add driver to source prop (at index), driven by target dataPath '''

    if index != -1:
        d = source.driver_add( prop, index ).driver
    else:
        d = source.driver_add( prop ).driver

    v = d.variables.new()
    v.name                 = prop
    v.targets[0].id        = target
    v.targets[0].data_path = dataPath

    d.expression = func + "(" + v.name + ")" if func else v.name
    d.expression = d.expression if not negative else "-1 * " + d.expression


You can then use it to link you empty and cube's Z scale this way for instance:

cube  = bpy.context.scene.objects['Cube']
empty = bpy.context.scene.objects['Empty']
add_driver( cube, empty, 'scale', 'scale.z', 2 )


I do have to say, though, that if you want to link the empty and the cube's scale, all you need to do is parent the cube to the empty, no driver is required.

cube.parent = empty