Sanitizes input using Python