You're using a fixed distance buffer
when you should be using a single sided buffer
. Please see usage examples below.
For QGIS 3:
x = processing.run("qgis:singlesidedbuffer", {'INPUT':'input.shp','DISTANCE':10,'SIDE':0,'SEGMENTS':8,'JOIN_STYLE':0,'MITER_LIMIT':2,'OUTPUT':'memory:'})
For QGIS 2.X, 5th parameter indicates side (0=right, 1=left):
x = processing.runalg("gdalogr:singlesidedbuffersandoffsetlinesforlines","input.shp",0,"geometry","10",1,False,None,False,"",None)
EDIT:
To add the resulting layer to the map, use the following command:
layer = iface.addVectorLayer(x['OUTPUT_LAYER'], "Single Buffer", "ogr")