How to add layer as child of group layer?

I have this code, which is working fine:

from krita import *
application = Krita.instance()
currentDoc = application.activeDocument()
layer2 = currentDoc.createFileLayer(“Layer2”,“C:\Dev\Logo\Screenshot.png”,“None”)
currentDoc.rootNode().addChildNode(layer2, None)
groupLayer = currentDoc.createGroupLayer(“Group3”)
currentDoc.rootNode().addChildNode(groupLayer, None)
currentDoc.refreshProjection()

Now I would like to add layer2 as child of groupLayer, but I can’t find any method, which can do that…
This code doesn’t do nothing:

groupLayer.addChildNode(layer2,None)

Any help much appreciated!

You’ll need to add it to the groupLayer instead of the rootNode, so make sure to remove this line
currentDoc.rootNode().addChildNode(layer2, None)
before calling
groupLayer.addChildNode(layer2, None)

By the way, wouldn’t that filepath with single backslashes \ trigger an error? It should have either double backslashes \\ or use forwardslashes /.

@freyalupen Thank you so much!!! I’m just starting, so I really appreciate the help! Backslashes work just fine on my Windows machine.