I wrote the following script, which runs fine from the QGIS python console (it loads two shapefiles, intersects them, and then finds the areas of the new regions):
import qgis.utilsimport qgis.corefrom qgis.analysis import *from PyQt4.QtCore import QVariantimport osprint(os.getcwd())layer1 =...