code: def inside_softimage():
      
      try:
          import maya
          return False
      except ImportError:
          pass
      try:
          from win32com.client import Dispatch as disp
          disp('XSI.Application')
          return True
      except:
          return False
docs: Returns a boolean indicating if the code is executed inside softimage.