Created
February 26, 2024 16:28
-
-
Save ychaouche/e38eb467d43e12d93bdf5a9639463561 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python3.6 unicodepython3.6 "j'ai réussi à écrire une version plus concise" | |
Traceback (most recent call last): | |
File "unicodepython3.6", line 9, in <module> | |
print(f"usertext was {usertext}") | |
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 19-20: surrogates not allowed | |
$ cat unicodepython3.6 | |
#!/usr/bin/python | |
import argparse | |
argparser = argparse.ArgumentParser() | |
argparser.add_argument("usertext",help="text to translate") | |
args=argparser.parse_args() | |
usertext = args.usertext | |
print(f"usertext was {usertext}") | |
$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment