How to make a script Execute in Editor only.

I know there is an attribute to make a script execute in editor, but, how can i do to, cleanly, make the script execute just when in editor mode and not while running the game?

Nevermind, found it!

I just used:

if(!Application.isPlaying)
{
 // code here for Editor only
}

I prefer meat5000’s solution

Use

 #if UNITY_EDITOR
      //Code here for Editor only.
  #endif

Unity - Manual: Conditional Compilation