Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * C# Script
- **/
- public void QGISChecker()
- {
- ScriptEngine pythonEngine = Python.CreateEngine();
- var scope = pythonEngine.CreateScope();
- var libs = new[] {
- dataPath + "IronPythonLib\\Python36\\Lib",
- dataPath + "qgis\\python",
- };
- pythonEngine.SetSearchPaths(libs);
- pythonEngine.ExecuteFile(dataPath + "Py_LivrableChecker\\__main__.py", scope);
- }
- ____________________________________________________________________________________________________________________________________
- /**
- * Python Script
- **/
- from qgis.core import *
- sss
- def main():
- # supply path to qgis install location
- QgsApplication.setPrefixPath("C:\Program Files\QGIS 3.0", True)
- # create a reference to the QgsApplication, setting the
- # second argument to False disables the GUI
- qgs = QgsApplication([], False)
- # load providers
- qgs.initQgis()
- print('FINALLY')
- # Write your code here to load some layers, use processing algorithms, etc.
- # When your script is complete, call exitQgis() to remove the provider and
- # layer registries from memory
- qgs.exitQgis()
- if __name__ == "__main__":
- print("Test.py is currently working...")
- main()
Advertisement
Add Comment
Please, Sign In to add comment