Editing Note:
Afterward, I see condition for resulting raster. In this case, code is as follows:
l=iface.activeLayer()
a=l.extent()
b=l.width()
c=l.height()
from qgis.analysis import QgsRasterCalculator, QgsRasterCalculatorEntry
rast = QgsRasterCalculatorEntry()
rast.ref = l.name() +'@1'
rast.raster = l
rast.bandNumber = 1
entries=[ rast ]
expression = '( (' + entries[0].ref + ' ) = 1 ) * 200 + ' + '( (' + entries[0].ref + ' ) != 1 ) * ' + entries[0].ref
print expression
calc = QgsRasterCalculator( expression,
"/home/zeito/pyqgis_data/z.tif",
'GTiff',
a,
b,
c,
entries )
calc.processCalculation()
After running it, results were obtained as expected.