Guest User

Untitled

a guest
Jun 1st, 2018
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. /**
  2. * C# Script
  3. **/
  4.  
  5. public void QGISChecker()
  6. {
  7. ScriptEngine pythonEngine = Python.CreateEngine();
  8. var scope = pythonEngine.CreateScope();
  9. var libs = new[] {
  10. dataPath + "IronPythonLib\\Python36\\Lib",
  11. dataPath + "qgis\\python",
  12. };
  13.  
  14. pythonEngine.SetSearchPaths(libs);
  15. pythonEngine.ExecuteFile(dataPath + "Py_LivrableChecker\\__main__.py", scope);
  16. }
  17.  
  18. ____________________________________________________________________________________________________________________________________
  19.  
  20. /**
  21. * Python Script
  22. **/
  23.  
  24. from qgis.core import *
  25. sss
  26. def main():
  27. # supply path to qgis install location
  28. QgsApplication.setPrefixPath("C:\Program Files\QGIS 3.0", True)
  29.  
  30. # create a reference to the QgsApplication, setting the
  31. # second argument to False disables the GUI
  32. qgs = QgsApplication([], False)
  33.  
  34. # load providers
  35. qgs.initQgis()
  36.  
  37. print('FINALLY')
  38.  
  39. # Write your code here to load some layers, use processing algorithms, etc.
  40. # When your script is complete, call exitQgis() to remove the provider and
  41. # layer registries from memory
  42. qgs.exitQgis()
  43.  
  44. if __name__ == "__main__":
  45. print("Test.py is currently working...")
  46. main()
Advertisement
Add Comment
Please, Sign In to add comment