python check if interactive mode