Alguém poderia me ajudar, estou tentando fazer conexão com banco de dados usando o pyqgis e esta dando erro nas duas últimas linhas
Erro:
Traceback (most recent call last):
File "C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\code.py", line 63, in runsource
code = self.compile(source, filename, symbol)
File "C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\codeop.py", line 168, in __call__
return _maybe_compile(self.compiler, source, filename, symbol)
File "C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\codeop.py", line 99, in _maybe_compile
raise err1
File "C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\codeop.py", line 87, in _maybe_compile
code1 = compiler(source + "\n", filename, symbol)
File "C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\codeop.py", line 133, in __call__
codeob = compile(source, filename, symbol, self.flags, 1)
File "<input>", line 7
print "layer%s did not load"% Layer.name ()
^
IndentationError: expected an indented block
QgsProject.instance().addMapLayer([layer])
Traceback (most recent call last):
File "C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\code.py", line 63, in runsource
code = self.compile(source, filename, symbol)
File "C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\codeop.py", line 168, in __call__
return _maybe_compile(self.compiler, source, filename, symbol)
File "C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\codeop.py", line 99, in _maybe_compile
raise err1
File "C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\codeop.py", line 87, in _maybe_compile
code1 = compiler(source + "\n", filename, symbol)
File "C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\codeop.py", line 133, in __call__
codeob = compile(source, filename, symbol, self.flags, 1)
File "<input>", line 1
QgsProject.instance().addMapLayer([layer])
^
IndentationError: unexpected indent