This python script exports Krita layers in the format of fileName_layerIndex_layerName.
How to use
Go to Tools -> Scripts -> Scripter and:
paste the Python script into the text editor section OR
go to File -> Open, navigate through the pop up file explorer and click on the python script.
Run the Python script by hitting the play button or typing Ctrl + R.
Your exported files should be in a folder near to your Krita project file.
Warning
You should export from a saved Krita project. An unsaved project will export the files into your home directory (within a folder named exported_layers or whatever you set the export_directory to in the script.).