Scaling cubes with individual origins in python api
Avoid ops for easy operations.

IMO many ops are a bridge between the user and the UI. For simple operations it is often simpler to set property values directly.

After the op cube has context. cube = context.object  . 

bpy.ops.mesh.primitive_cube_add()
cube = context.object


To uniformly scale about the origin  

cube.scale *= 1.7718


Alternatively can set size in the operator

bpy.ops.mesh.primitive_cube_add(size=2 * 1.7718)


which will "apply" the scale.

Finally: To have the two cubes only touching use 1.5