Python: Toplevel script check