Or even:if int(gp.GetCount_management(featureLayer).getoutput(0)) > 0:
do this
else:
do that
Sometimes it's usefull to compare the selection count with the total count:
if int(gp.GetCount_management(gp.describe(featureLayer).catalogpath).getoutput(0)) > int(gp.GetCount_management(featureLayer).getoutput(0)):
do this
else:
do that
And then its sometimes usefull to get the OBJECTIDs of the selected features (BTW there has to be a selection in the featurelayer not just a SQL definition):selectedOidList = [int(oid) for oid in gp.describe(featureLayer).fidset.split(";")]