I wrote a processing tool, which exports some tables from PostGIS to package, and as part of the export, I am calling an external SQL file to add some triggers, etc. The SQL file is located as my script (
Currently, I linked the SQL file as follows.
path_to_sql = str(Path.home()) + "\\AppData\\Roaming\\QGIS\\QGIS3\\profiles\\default\\processing\\scripts\\bwk.sql" sql_file = open(path_to_sql)
But I was wondering, why it does not work when I wrote
path_to_sql = "\\bwk.sql" or
path_to_sql ="bwk.sql" (No such file or directory: 'bwk.sql')