#!/usr/bin/python3 # ==================================================================== # test input example: abc\u00c5xyz # ==================================================================== import ast while True: x = input('enter: ') x = x.strip() if not x: break if x.find('"') > -1: print('\'"\' is not allowed in input. Change the input or the code.') continue y = ast.literal_eval('"' + x + '"') print(y)