I am creating layers from shp file during my process on my python code.Using makefeaturelayer tool puts lock file to the shp file and, if I do not delete that layer inside the code, I cannot erase that shp file due to lock.
My question is is there any way to extract names of created layers, so that I can erase them and prevent my shps having a lock file ?