Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PyQt4.QtCore import QFileInfo
- from qgis.core import *
- def main():
- QgsApplication([], True)
- QgsApplication.setPrefixPath('/usr/share/qgis', False) #If this is set to true qgis can't find resources..
- QgsApplication.initQgis()
- proj=QgsProject.instance()
- proj.read(QFileInfo("source.qgs"))
- #do other stuff to the project
- proj.write(QFileInfo("target.qgs"))
- QgsApplication.exitQgis()
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement