python check if in interactive mode