def in_idle():
 import sys
 return (sys.stdin.__class__.__name__ in ('PyShell', 'RPCProxy'))

def in_idle ( ) : import sys return ( sys . stdin . __class__ . __name__ in ( 'PyShell' , 'RPCProxy' ) )
return true if this function is run within idle .