I'm quite new to Python and programming in general.
I have created a few scripts using Python and as part of my framework/best practices for my scripts, I'd like to display when a script begins and ends in the IDLE shell. For now, I have just been adding a print function with the name of the script. So for example for a script called "UpdateMaps.py", I would have:
import arcpy, os
print "BEGIN: 'UpdateMaps'"
<some script that updates maps>
print "COMPLETED: 'UpdateMaps'"
But I would prefer to have the script name be printed automatically, since I often cut and paste pieces of script to another one, change the name of the scripts, etc.
So I would prefer something like this (I'm making up the 'str(scriptname)' object as an idea of what I'm looking for):
import arcpy, os
print "BEGIN: " + str(scriptname)
<some script that updates maps>
print "COMPLETED: " + str(scriptname)
Is there a way to do that?