1

With QGIS 3.6.2 on Ubuntu 18.04 I can't get the startup.py file to execute. Checked the docs and default folders with QStandardPaths.standardLocations(QStandardPaths.AppDataLocation) and added the startup into the final folder /home/jaume/.local/share/QGIS/QGIS3/profiles/default/python nothing happens. The test code I want to execute is:

f = open("/home/jaume/aaa.txt","w+")
f.write("This is a line")
f.close()

I've tryed other silly code, added execution permissions, tested that this code runs in the python3 console, etc. Nothing happens. Any advice?

Fran Raga
  • 7,838
  • 3
  • 26
  • 47
Jaume Figueras
  • 266
  • 1
  • 3
  • the correct folder is C:\Users\<username>\AppData\Roaming\QGIS\QGIS3, check this https://gis.stackexchange.com/a/318817/49538 in your case I think is /home/jaume/.local/share/QGIS/QGIS3 – Fran Raga May 07 '19 at 16:52
  • Thank you @FranRaga this works. Docs say something different: https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/intro.html#the-startup-py-file Wich is best, tell the devs to corrrect the search folder or tell the docs are incorrect.... – Jaume Figueras May 07 '19 at 21:08
  • I put my comment as an answer – Fran Raga May 08 '19 at 17:34

1 Answers1

2

The correct folder is:

C:\Users\<username>\AppData\Roaming\QGIS\QGIS3, check this in your case I think is

/home/jaume/.local/share/QGIS/QGIS3
Fran Raga
  • 7,838
  • 3
  • 26
  • 47