def str_to_unicode(s: str): return s.encode("unicode_escape").decode() print(str_to_unicode('Python is Great '))