I'm new in PyQgis. I'm looking for a code to move one layer in TOC to a specific position. Is it possible?
You may want to read this tutorial on the PyQGIS Tree Layer API (Part I & II). This contains a part on how to move a layer within the layer TOC.