Peter> hasattr(sys, "ps1") Thanks. I wasn't aware there was a documented way to check for interactivity. It would have been more obvious if sys had an "isinteractive" method or attribute. -- Skip Montanaro - skip at pobox.com - http://smontanaro.dyndns.org/